mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Merge pull request #2994 from JacobBarthelmeh/Xilinx
add additional sanity check on pointer before free
This commit is contained in:
@ -1847,11 +1847,15 @@ static int wc_RsaFunctionSync(const byte* in, word32 inLen, byte* out,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
if (XSecure_RsaPrivateDecrypt(&rsa, (u8*)in, inLen, out) != XST_SUCCESS) {
|
if (XSecure_RsaPrivateDecrypt(&rsa, (u8*)in, inLen, out) !=
|
||||||
|
XST_SUCCESS) {
|
||||||
ret = BAD_STATE_E;
|
ret = BAD_STATE_E;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFREE(d, key->heap, DYNAMIC_TYPE_PRIVATE_KEY);
|
|
||||||
|
if (d != NULL) {
|
||||||
|
XFREE(d, key->heap, DYNAMIC_TYPE_PRIVATE_KEY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user