summaryrefslogtreecommitdiff
path: root/main/logger.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-01-22 11:48:24 -0600
committerRichard Mudgett <rmudgett@digium.com>2016-01-22 11:50:41 -0600
commit1c95b211a0416c0d9ee0a732fe5615a356e7c12f (patch)
tree94ad54da95d430e0cdd3aa72ee9ee87947379cdb /main/logger.c
parenta0d3932e2a91c5074403c07f2e626ac1db1894cc (diff)
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
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/main/logger.c b/main/logger.c
index fb9e8ed4f..46d9cbb57 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -464,7 +464,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;
}