Fix a few missed "if (!ptr)" cleanups

And a scalar !x --> x==0 test
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
This commit is contained in:
Rich Salz 2015-11-23 13:30:04 -05:00 committed by Rich Salz
parent e44380a990
commit cc99bfa76b
3 changed files with 5 additions and 6 deletions

View File

@ -471,7 +471,7 @@ BIO *BIO_find_type(BIO *bio, int type)
{ {
int mt, mask; int mt, mask;
if (!bio) if (bio == NULL)
return NULL; return NULL;
mask = type & 0xff; mask = type & 0xff;
do { do {
@ -491,7 +491,7 @@ BIO *BIO_find_type(BIO *bio, int type)
BIO *BIO_next(BIO *b) BIO *BIO_next(BIO *b)
{ {
if (!b) if (b == NULL)
return NULL; return NULL;
return b->next_bio; return b->next_bio;
} }

View File

@ -175,12 +175,11 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length)
/* Save start position */ /* Save start position */
q = *pp; q = *pp;
if (!a || *a == NULL) { if (a == NULL || *a == NULL)
freeret = 1; freeret = 1;
}
ret = d2i_X509(a, &q, length); ret = d2i_X509(a, &q, length);
/* If certificate unreadable then forget it */ /* If certificate unreadable then forget it */
if (!ret) if (ret == NULL)
return NULL; return NULL;
/* update length */ /* update length */
length -= q - *pp; length -= q - *pp;

View File

@ -466,7 +466,7 @@ int ssl_get_new_session(SSL *s, int session)
* Don't allow the callback to set the session length to zero. nor * Don't allow the callback to set the session length to zero. nor
* set it higher than it was. * set it higher than it was.
*/ */
if (!tmp || (tmp > ss->session_id_length)) { if (tmp == 0 || tmp > ss->session_id_length) {
/* The callback set an illegal length */ /* The callback set an illegal length */
SSLerr(SSL_F_SSL_GET_NEW_SESSION, SSLerr(SSL_F_SSL_GET_NEW_SESSION,
SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH); SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH);