[Asterisk-code-review] channel.c: Address stack overflow in does id conflict() (asterisk[16])

George Joseph asteriskteam at digium.com
Mon Sep 24 09:24:32 CDT 2018


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/10242 )

Change subject: channel.c:  Address stack overflow in does_id_conflict()
......................................................................

channel.c:  Address stack overflow in does_id_conflict()

does_id_conflict() was passing a pointer to an int to a callback
that expected a pointer to a size_t.

Found by the Address Sanitizer.

Change-Id: I0ff542067eef63a14a60301654d65d34fe2ad503
---
M main/channel.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved
  George Joseph: Approved for Submit



diff --git a/main/channel.c b/main/channel.c
index b549299..eb0e34a 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -751,7 +751,7 @@
 static int does_id_conflict(const char *uniqueid)
 {
 	struct ast_channel *conflict;
-	int length = 0;
+	size_t length = 0;
 
 	if (ast_strlen_zero(uniqueid)) {
 		return 0;

-- 
To view, visit https://gerrit.asterisk.org/10242
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-MessageType: merged
Gerrit-Change-Id: I0ff542067eef63a14a60301654d65d34fe2ad503
Gerrit-Change-Number: 10242
Gerrit-PatchSet: 1
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2 (1000185)
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180924/2d0a4ee4/attachment.html>


More information about the asterisk-code-review mailing list