projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
209c3d3
)
coverity 1462580 Improper use of negative value
author
Pauli
<paul.dale@oracle.com>
Sun, 26 Apr 2020 23:28:55 +0000
(09:28 +1000)
committer
Pauli
<paul.dale@oracle.com>
Thu, 30 Apr 2020 10:21:33 +0000
(20:21 +1000)
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)
crypto/hmac/hmac.c
patch
|
blob
|
history
diff --git
a/crypto/hmac/hmac.c
b/crypto/hmac/hmac.c
index b49baec4c1e3806c7670cd8a22a3a6b9e48af83b..6c1a70e4bdad16c65b694828327ba087f9ae6c32 100644
(file)
--- a/
crypto/hmac/hmac.c
+++ b/
crypto/hmac/hmac.c
@@
-55,6
+55,8
@@
int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
j = EVP_MD_block_size(md);
if (!ossl_assert(j <= (int)sizeof(keytmp)))
return 0;
+ if (j < 0)
+ return 0;
if (j < len) {
if (!EVP_DigestInit_ex(ctx->md_ctx, md, impl)
|| !EVP_DigestUpdate(ctx->md_ctx, key, len)