Stricter boundary condition check in HMAC_Init_ex.
authorAndy Polyakov <appro@openssl.org>
Sun, 25 Jul 2004 19:25:05 +0000 (19:25 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 25 Jul 2004 19:25:05 +0000 (19:25 +0000)
crypto/hmac/hmac.c

index 50765e227bf2ef0a3a0c134537dc390c7bff4d23..b1aa05b2eaa5b2b2e3a8cbc79f81307286b05f47 100644 (file)
@@ -89,7 +89,7 @@ void HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
                        }
                else
                        {
-                       OPENSSL_assert(len <= (int)sizeof(ctx->key));
+                       OPENSSL_assert(len>0 && len <= (int)sizeof(ctx->key));
                        memcpy(ctx->key,key,len);
                        ctx->key_length=len;
                        }