fixed mp_add_d overflow

pull/1/head
John Safranek 2012-12-27 10:08:44 -08:00
parent cf114b92df
commit 0cfa423566
1 changed files with 4 additions and 2 deletions

View File

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