Fix null pointer dereference in ssl_module_init
authorDaniel DeFreez <daniel@defreez.com>
Thu, 7 Feb 2019 17:55:14 +0000 (09:55 -0800)
committerPauli <paul.dale@oracle.com>
Sun, 10 Feb 2019 22:30:46 +0000 (08:30 +1000)
CLA: Trivial

Reviewed-by: Paul Yang <yang.yang@baishancloud.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8183)

crypto/conf/conf_ssl.c

index a1b24b2..d703f73 100644 (file)
@@ -78,6 +78,8 @@ static int ssl_module_init(CONF_IMODULE *md, const CONF *cnf)
     cnt = sk_CONF_VALUE_num(cmd_lists);
     ssl_module_free(md);
     ssl_names = OPENSSL_zalloc(sizeof(*ssl_names) * cnt);
+    if (ssl_names == NULL)
+        goto err;
     ssl_names_count = cnt;
     for (i = 0; i < ssl_names_count; i++) {
         struct ssl_conf_name_st *ssl_name = ssl_names + i;