forked from wolfSSL/wolfssl
Scan-Build Fixes
1. Added a check to see if the "d" in sp_div() ended up with a negative used length. Return error if so. To recreate: $ scan-build ./configure --enable-sp --enable-sp-asm --enable-sp-math
This commit is contained in:
@ -927,6 +927,9 @@ static int sp_div(sp_int* a, sp_int* d, sp_int* r, sp_int* rem)
|
||||
d = sd;
|
||||
}
|
||||
|
||||
if (d->used < 0)
|
||||
err = MP_VAL;
|
||||
|
||||
tr->used = sa->used - d->used + 1;
|
||||
sp_clear(tr);
|
||||
tr->used = sa->used - d->used + 1;
|
||||
|
Reference in New Issue
Block a user