提交 48b05bb6 编写于 作者: P Pauli 提交者: Pauli

evp: fix coverity 1451510: argument cannot be negative

Reviewed-by: NMatt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14620)
上级 1002bb9f
......@@ -75,7 +75,11 @@ const EVP_CIPHER *EVP_rc4_40(void)
static int rc4_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv, int enc)
{
RC4_set_key(&data(ctx)->ks, EVP_CIPHER_CTX_key_length(ctx), key);
int keylen;
if ((keylen = EVP_CIPHER_CTX_key_length(ctx)) <= 0)
return 0;
RC4_set_key(&data(ctx)->ks, keylen, key);
return 1;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册