diff options
author | Rob Percival <robpercival@google.com> | 2016-03-03 16:08:55 +0000 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-03-04 10:50:10 -0500 |
commit | 2508c047eb116df36c3189f767313cb65fd5283c (patch) | |
tree | ed9b2e6ac0c53e027d841f35e1c7db62fd80fa6d /crypto/ct/ct_log.c | |
parent | 0c6ea56568f8dbc5d83cd737d81cd7362295acf0 (diff) |
Handle empty log name in "enable_logs" line of the CT log file
e.g. "enabled_logs = foo,,bar"
Reviewed-by: Ben Laurie <ben@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ct/ct_log.c')
-rw-r--r-- | crypto/ct/ct_log.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/ct/ct_log.c b/crypto/ct/ct_log.c index 1a98c7a0bd..03cb51ffec 100644 --- a/crypto/ct/ct_log.c +++ b/crypto/ct/ct_log.c @@ -213,8 +213,13 @@ static int ctlog_store_load_log(const char *log_name, int log_name_len, CTLOG_STORE_LOAD_CTX *load_ctx = arg; CTLOG *ct_log; /* log_name may not be null-terminated, so fix that before using it */ - char *tmp = OPENSSL_strndup(log_name, log_name_len); + char *tmp; + /* log_name will be NULL for empty list entries */ + if (log_name == NULL) + return 1; + + tmp = OPENSSL_strndup(log_name, log_name_len); ct_log = ctlog_new_from_conf(load_ctx->conf, tmp); OPENSSL_free(tmp); if (ct_log == NULL) { |