sp_int.c sp_div(): add missing (err == MP_OKAY) clause to fix null ptr deref.

This commit is contained in:
Daniel Pouzzner
2022-07-28 09:27:49 -05:00
parent 3ac04fa3ee
commit 545ba58cc0

View File

@ -7121,7 +7121,7 @@ int sp_div(sp_int* a, sp_int* d, sp_int* r, sp_int* rem)
}
}
if (!done) {
if ((!done) && (err == MP_OKAY)) {
#if (defined(WOLFSSL_SMALL_STACK) || defined(SP_ALLOC)) && \
!defined(WOLFSSL_SP_NO_MALLOC)
int cnt = 4;