Skip to content

Commit

Permalink
Add NULL checks from master
Browse files Browse the repository at this point in the history
The big "don't check for NULL" cleanup requires backporting some
of the lowest-level functions to actually do nothing if NULL is
given.  This will make it easier to backport fixes to release
branches, where master assumes those lower-level functions are "safe"

This commit addresses those tickets: 3798 3799 3801.

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit f34b095)
  • Loading branch information
richsalz authored and Rich Salz committed May 13, 2015
1 parent 6c63867 commit 690d040
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/x509/x509_lu.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ X509_STORE *X509_STORE_new(void)

static void cleanup(X509_OBJECT *a)
{
if (!a)
return;
if (a->type == X509_LU_X509) {
X509_free(a->data.x509);
} else if (a->type == X509_LU_CRL) {
Expand Down
2 changes: 2 additions & 0 deletions crypto/x509/x509_vfy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,8 @@ X509_STORE_CTX *X509_STORE_CTX_new(void)

void X509_STORE_CTX_free(X509_STORE_CTX *ctx)
{
if (!ctx)
return;
X509_STORE_CTX_cleanup(ctx);
OPENSSL_free(ctx);
}
Expand Down

0 comments on commit 690d040

Please sign in to comment.