diff options
author | Rich Salz <rsalz@akamai.com> | 2019-09-16 15:28:57 -0400 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-09 21:32:15 +0200 |
commit | 12a765a5235f181c2f4992b615eb5f892c368e88 (patch) | |
tree | 67ece1a3fb210bd4895aea73649773fc912a60d6 /crypto/evp/evp_pbe.c | |
parent | 3a4e43de473ee80347036d78163889b6b1221210 (diff) | |
download | openssl-12a765a5235f181c2f4992b615eb5f892c368e88.tar.gz |
Explicitly test against NULL; do not use !p or similar
Also added blanks lines after declarations in a couple of places.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9916)
Diffstat (limited to 'crypto/evp/evp_pbe.c')
-rw-r--r-- | crypto/evp/evp_pbe.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/evp_pbe.c b/crypto/evp/evp_pbe.c index 5ccb8214a3..a9f94bd5bc 100644 --- a/crypto/evp/evp_pbe.c +++ b/crypto/evp/evp_pbe.c @@ -93,8 +93,9 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, if (!EVP_PBE_find(EVP_PBE_TYPE_OUTER, OBJ_obj2nid(pbe_obj), &cipher_nid, &md_nid, &keygen)) { char obj_tmp[80]; + EVPerr(EVP_F_EVP_PBE_CIPHERINIT, EVP_R_UNKNOWN_PBE_ALGORITHM); - if (!pbe_obj) + if (pbe_obj == NULL) OPENSSL_strlcpy(obj_tmp, "NULL", sizeof(obj_tmp)); else i2t_ASN1_OBJECT(obj_tmp, sizeof(obj_tmp), pbe_obj); @@ -102,7 +103,7 @@ int EVP_PBE_CipherInit(ASN1_OBJECT *pbe_obj, const char *pass, int passlen, return 0; } - if (!pass) + if (pass == NULL) passlen = 0; else if (passlen == -1) passlen = strlen(pass); |