diff options
author | Matt Caswell <matt@openssl.org> | 2018-10-01 13:16:55 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-10-02 10:52:57 +0100 |
commit | 434893af2bd4c1fa72655f8e5262c8a432713968 (patch) | |
tree | f3a44b5b70962001edefd084291215bfc42a7cde | |
parent | c20a76f695922f409c316399f7290530f7728f19 (diff) |
Fix some Coverity warnings
Check some return values on some functions.
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7335)
-rw-r--r-- | crypto/evp/e_rc2.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/evp/e_rc2.c b/crypto/evp/e_rc2.c index 80afe316d7..234d1eb14f 100644 --- a/crypto/evp/e_rc2.c +++ b/crypto/evp/e_rc2.c @@ -92,7 +92,8 @@ static int rc2_meth_to_magic(EVP_CIPHER_CTX *e) { int i; - EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i); + if (EVP_CIPHER_CTX_ctrl(e, EVP_CTRL_GET_RC2_KEY_BITS, 0, &i) <= 0) + return 0; if (i == 128) return RC2_128_MAGIC; else if (i == 64) @@ -136,8 +137,9 @@ static int rc2_get_asn1_type_and_iv(EVP_CIPHER_CTX *c, ASN1_TYPE *type) return -1; if (i > 0 && !EVP_CipherInit_ex(c, NULL, NULL, NULL, iv, -1)) return -1; - EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, NULL); - if (EVP_CIPHER_CTX_set_key_length(c, key_bits / 8) <= 0) + if (EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_RC2_KEY_BITS, key_bits, + NULL) <= 0 + || EVP_CIPHER_CTX_set_key_length(c, key_bits / 8) <= 0) return -1; } return i; |