axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billblo...@apache.org
Subject svn commit: r1866244 - /axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c
Date Sun, 01 Sep 2019 19:45:58 GMT
Author: billblough
Date: Sun Sep  1 19:45:58 2019
New Revision: 1866244

URL: http://svn.apache.org/viewvc?rev=1866244&view=rev
Log:
Fix possible null pointer dereference

Modified:
    axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c

Modified: axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c?rev=1866244&r1=1866243&r2=1866244&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c (original)
+++ axis/axis2/c/core/trunk/src/core/transport/http/sender/ssl/ssl_utils.c Sun Sep  1 19:45:58
2019
@@ -243,19 +243,19 @@ axis2_ssl_utils_initialize_ssl(
 
                 if (ASN1_STRING_cmp(peer_sig, client_sig) == 0)
                 {
-                    /* if the caller passed a hostname, verify it against the cert */
-                    if (host) {
-                        if (X509_check_host(peer_cert, host, strlen(host), 0, NULL) == 1)
{
-                            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                                    "[ssl client] peer name matches certificate CN/SAN");
-                        } else {
-                            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                                    "[ssl client] peer name does not match certificate CN/SAN");
-                            return NULL;
+                    if (peer_cert) {
+                        /* if the caller passed a hostname, verify it against the cert */
+                        if (host) {
+                            if (X509_check_host(peer_cert, host, strlen(host), 0, NULL) ==
1) {
+                                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+                                        "[ssl client] peer name matches certificate CN/SAN");
+                            } else {
+                                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+                                        "[ssl client] peer name does not match certificate
CN/SAN");
+                                X509_free(peer_cert);
+                                return NULL;
+                            }
                         }
-                    }
-                    if (peer_cert)
-                    {
                         X509_free(peer_cert);
                     }
                     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,



Mime
View raw message