Skip to content

Commit de20bb7

Browse files
fix for coverity issue 394677
1 parent d5016d4 commit de20bb7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

wolfcrypt/src/evp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3283,6 +3283,8 @@ int wolfSSL_EVP_PKEY_bits(const WOLFSSL_EVP_PKEY *pkey)
32833283
if (pkey == NULL) return 0;
32843284
WOLFSSL_ENTER("wolfSSL_EVP_PKEY_bits");
32853285
if ((bytes = wolfSSL_EVP_PKEY_size((WOLFSSL_EVP_PKEY*)pkey)) ==0) return 0;
3286+
if (bytes < 0)
3287+
return 0;
32863288
return bytes*8;
32873289
}
32883290

0 commit comments

Comments
 (0)