Handle missing "enabled_logs" line in CT log file
authorRob Percival <robpercival@google.com>
Thu, 3 Mar 2016 16:08:01 +0000 (16:08 +0000)
committerRich Salz <rsalz@openssl.org>
Fri, 4 Mar 2016 15:50:10 +0000 (10:50 -0500)
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/ct/ct_log.c

index f5a01fdbd329e385d5caf2af0eba9155cc2edd80..1a98c7a0bd92f08f656e52b14abc791cc12cc2e5 100644 (file)
@@ -245,6 +245,12 @@ int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file)
     }
 
     enabled_logs = NCONF_get_string(load_ctx->conf, NULL, "enabled_logs");
+    if (enabled_logs == NULL) {
+        ret = 0;
+        CTerr(CT_F_CTLOG_STORE_LOAD_FILE, CT_R_LOG_CONF_INVALID);
+        goto end;
+    }
+
     ret = CONF_parse_list(enabled_logs, ',', 1, ctlog_store_load_log, load_ctx);
     if (ret == 1 && load_ctx->invalid_log_entries > 0) {
         ret = 0;