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:33:28 +0000 (08:33 +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)

(cherry picked from commit 758229f7d22775d7547e3b3b886b7f6a289c6897)

crypto/conf/conf_ssl.c

index 024bdb4808e394aadfef94e31ea6ffc37d1efd93..8508d2ea0dca755d58202bb13ebecdd697141646 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;