mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 12:44:45 +02:00
wolfcrypt/src/wc_kyber.c: fixes for null derefs (nullPointerRedundantCheck) in wc_KyberKey_MakeKeyWithRandom() and wc_KyberKey_Decapsulate() added in d350ba6c41
.
This commit is contained in:
@@ -286,7 +286,9 @@ int wc_KyberKey_MakeKeyWithRandom(KyberKey* key, const unsigned char* rand,
|
||||
}
|
||||
|
||||
/* Free dynamic memory allocated in function. */
|
||||
XFREE(a, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (key != NULL) {
|
||||
XFREE(a, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -890,7 +892,9 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
|
||||
|
||||
#ifndef USE_INTEL_SPEEDUP
|
||||
/* Dispose of dynamic memory allocated in function. */
|
||||
XFREE(cmp, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
if (key != NULL) {
|
||||
XFREE(cmp, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user