We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6727837 commit c7924e5Copy full SHA for c7924e5
crypto/fipsmodule/kem/kem.c
@@ -331,6 +331,12 @@ int KEM_KEY_set_raw_keypair_from_seed(KEM_KEY *key, const CBS *seed) {
331
uint8_t *public_key = OPENSSL_malloc(key->kem->public_key_len);
332
uint8_t *secret_key = OPENSSL_malloc(key->kem->secret_key_len);
333
334
+ if (public_key == NULL || secret_key == NULL) {
335
+ OPENSSL_free(public_key);
336
+ OPENSSL_free(secret_key);
337
+ OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE);
338
+ return 0;
339
+ }
340
size_t public_len = key->kem->public_key_len;
341
size_t secret_len = key->kem->secret_key_len;
342
0 commit comments