From: Richard Mudgett Date: Fri, 22 Jan 2016 17:48:24 +0000 (-0600) Subject: logger.c: Fix buffer overrun found by address sanitizer. X-Git-Tag: 11.22.0-rc1~29 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F69%2F2069%2F1;p=thirdparty%2Fasterisk.git logger.c: Fix buffer overrun found by address sanitizer. The null terminator of the tail struct member was not being allocated when no logger.conf config file is installed. ASTERISK-25714 #close Reported by: Badalian Vyacheslav Change-Id: I45770fdd08af39506a3bc33ba279c4f16e047a30 --- diff --git a/main/logger.c b/main/logger.c index 795c85d97b..aeb07325d6 100644 --- a/main/logger.c +++ b/main/logger.c @@ -408,7 +408,7 @@ static int init_logger_chain(int locked, const char *altconf) /* If no config file, we're fine, set default options. */ if (!cfg) { - if (!(chan = ast_calloc(1, sizeof(*chan)))) { + if (!(chan = ast_calloc(1, sizeof(*chan) + 1))) { fprintf(stderr, "Failed to initialize default logging\n"); return -1; }