fixed mp_add_d overflow

This commit is contained in:
John Safranek
2012-12-27 10:08:44 -08:00
parent cf114b92df
commit 0cfa423566

View File

@@ -3792,8 +3792,10 @@ int mp_add_d (mp_int* a, mp_digit b, mp_int* c)
*tmpc++ &= MP_MASK; *tmpc++ &= MP_MASK;
} }
/* set final carry */ /* set final carry */
if (mu != 0 && ix < c->alloc) {
ix++; ix++;
*tmpc++ = mu; *tmpc++ = mu;
}
/* setup size */ /* setup size */
c->used = a->used + 1; c->used = a->used + 1;