[Asterisk-code-review] acl.c: Coerce a NULL pointer into the empty string (asterisk[13])

Sean Bright asteriskteam at digium.com
Mon Jul 13 15:43:57 CDT 2020


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/14636 )


Change subject: acl.c: Coerce a NULL pointer into the empty string
......................................................................

acl.c: Coerce a NULL pointer into the empty string

If an ACL is misconfigured in the realtime database (for instance, the
"rule" is blank) and Asterisk attempts to read the ACL, Asterisk will
crash.

ASTERISK-28978 #close

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



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/36/14636/1

diff --git a/main/acl.c b/main/acl.c
index 3d32976..b1b838f 100644
--- a/main/acl.c
+++ b/main/acl.c
@@ -580,7 +580,7 @@
 	struct ast_ha *ha;
 	struct ast_ha *prev = NULL;
 	struct ast_ha *ret;
-	char *tmp, *list = ast_strdupa(stuff);
+	char *tmp, *list = ast_strdupa(stuff ?: "");
 	char *address = NULL, *mask = NULL;
 	int addr_is_v4;
 	int allowing = strncasecmp(sense, "p", 1) ? AST_SENSE_DENY : AST_SENSE_ALLOW;

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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ic1536c4df856231bfd2da00128f7822224d77610
Gerrit-Change-Number: 14636
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200713/199d557c/attachment.html>


More information about the asterisk-code-review mailing list