Merge pull request #140 from libtom/fix/missing_check

fix missing check of return value
This commit is contained in:
Steffen Jaeckel 2018-12-26 16:22:58 +01:00 committed by GitHub
commit b722832b32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -335,7 +335,9 @@ int mp_prime_is_prime(const mp_int *a, int t, int *result)
len = mp_count_bits(&b);
if (len > size_a) {
len = len - size_a;
mp_div_2d(&b, len, &b, NULL);
if ((err = mp_div_2d(&b, len, &b, NULL)) != MP_OKAY) {
goto LBL_B;
}
}
/* Although the chance for b <= 3 is miniscule, try again. */