Skip to content

Commit f13abf3

Browse files
jogmenhorman
authored andcommitted
Address coverity issue 1655294
Fixes: openssl/project#1267 Signed-off-by: Norbert Pocs <norbertp@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from openssl#27989)
1 parent 51ce549 commit f13abf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crypto/ml_kem/ml_kem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,15 +1678,15 @@ ML_KEM_KEY *ossl_ml_kem_key_dup(const ML_KEM_KEY *key, int selection)
16781678
void *tmp_pub;
16791679
void *tmp_priv;
16801680

1681+
if (key == NULL)
1682+
return NULL;
16811683
/*
16821684
* Partially decoded keys, not yet imported or loaded, should never be
16831685
* duplicated.
16841686
*/
16851687
if (ossl_ml_kem_decoded_key(key))
16861688
return NULL;
16871689

1688-
if (key == NULL)
1689-
return NULL;
16901690
else if ((ret = OPENSSL_memdup(key, sizeof(*key))) == NULL)
16911691
return NULL;
16921692

0 commit comments

Comments
 (0)