X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Fhmac%2Fhmac.c;fp=crypto%2Fhmac%2Fhmac.c;h=6c1a70e4bdad16c65b694828327ba087f9ae6c32;hb=206da660a37e84b7266db4e2c4e9485cdafb1366;hp=b49baec4c1e3806c7670cd8a22a3a6b9e48af83b;hpb=209c3d3ef655a807cdb109f3316bb86433ae7f07;p=openssl.git diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c index b49baec4c1..6c1a70e4bd 100644 --- 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)