From: Richard Russon Date: Mon, 29 Apr 2019 13:57:29 +0000 (+0100) Subject: libmutt: fix logging code for degenerate cases X-Git-Tag: 2019-10-25~233^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c4a0e2e91d7405b282ea2dbbaf1c41c5246aabd;p=neomutt libmutt: fix logging code for degenerate cases --- diff --git a/mutt/logging.c b/mutt/logging.c index ef75f4ae1..a212f4638 100644 --- a/mutt/logging.c +++ b/mutt/logging.c @@ -147,6 +147,9 @@ int log_file_open(bool verbose) */ int log_file_set_filename(const char *file, bool verbose) { + if (!file) + return -1; + /* also handles both being NULL */ if (mutt_str_strcmp(LogFileName, file) == 0) return 0; @@ -291,6 +294,9 @@ int log_disp_file(time_t stamp, const char *file, int line, */ int log_queue_add(struct LogLine *ll) { + if (!ll) + return -1; + STAILQ_INSERT_TAIL(&LogQueue, ll, entries); if ((LogQueueMax > 0) && (LogQueueCount >= LogQueueMax))