Fix use of NULL memory pointer in X509_VERIFY_PARAM_new in the event of a
authorMatt Caswell <matt@openssl.org>
Thu, 4 Dec 2014 10:18:40 +0000 (10:18 +0000)
committerMatt Caswell <matt@openssl.org>
Fri, 12 Dec 2014 23:52:41 +0000 (23:52 +0000)
malloc failure.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
(cherry picked from commit c6a84ff3516d8ecd92d866b6f0ae0d63df6d9c53)

crypto/x509/x509_vpm.c

index dfd89d89faf0e885b2dca37ed1edcc11248c3aa0..ba546bd1fabf04ef4c3df5c544be35feeacb6b3e 100644 (file)
@@ -89,6 +89,8 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
        {
        X509_VERIFY_PARAM *param;
        param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
+       if (!param)
+               return NULL;
        memset(param, 0, sizeof(X509_VERIFY_PARAM));
        x509_verify_param_zero(param);
        return param;