mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user