diff options
author | Rich Salz <rsalz@akamai.com> | 2019-09-16 21:28:57 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-09 21:32:15 +0200 |
commit | 12a765a5235f181c2f4992b615eb5f892c368e88 (patch) | |
tree | 67ece1a3fb210bd4895aea73649773fc912a60d6 /crypto/x509/v3_utl.c | |
parent | Refactor -passin/-passout documentation (diff) | |
download | openssl-12a765a5235f181c2f4992b615eb5f892c368e88.tar.xz openssl-12a765a5235f181c2f4992b615eb5f892c368e88.zip |
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/x509/v3_utl.c')
-rw-r--r-- | crypto/x509/v3_utl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/x509/v3_utl.c b/crypto/x509/v3_utl.c index 1516d988f0..50fa404996 100644 --- a/crypto/x509/v3_utl.c +++ b/crypto/x509/v3_utl.c @@ -380,14 +380,14 @@ static char *strip_spaces(char *name) p = name; while (*p && ossl_isspace(*p)) p++; - if (!*p) + if (*p == '\0') return NULL; q = p + strlen(p) - 1; while ((q != p) && ossl_isspace(*q)) q--; if (p != q) q[1] = 0; - if (!*p) + if (*p == '\0') return NULL; return p; } @@ -989,11 +989,12 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) unsigned char ipout[32]; char *iptmp = NULL, *p; int iplen1, iplen2; + p = strchr(ipasc, '/'); - if (!p) + if (p == NULL) return NULL; iptmp = OPENSSL_strdup(ipasc); - if (!iptmp) + if (iptmp == NULL) return NULL; p = iptmp + (p - ipasc); *p++ = 0; |