[asterisk-commits] logger.c: Fix buffer overrun found by address sanitizer. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 22 14:57:58 CST 2016


Matt Jordan has submitted this change and it was merged.

Change subject: logger.c: Fix buffer overrun found by address sanitizer.
......................................................................


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
---
M main/logger.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/main/logger.c b/main/logger.c
index fac68d9..13f6de8 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -601,7 +601,7 @@
 
 	/* 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;
 		}

-- 
To view, visit https://gerrit.asterisk.org/2068
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I45770fdd08af39506a3bc33ba279c4f16e047a30
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list