]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
acl.c: Coerce a NULL pointer into the empty string
authorSean Bright <sean.bright@gmail.com>
Mon, 13 Jul 2020 20:42:40 +0000 (16:42 -0400)
committerJoshua Colp <jcolp@sangoma.com>
Mon, 20 Jul 2020 14:57:52 +0000 (09:57 -0500)
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

main/acl.c

index 3d329768573d7c18e3dfcdd08c8d5ac43456d786..b1b838fd224f0add56afd8bb9ba7e3275feb093c 100644 (file)
@@ -580,7 +580,7 @@ static struct ast_ha *append_ha_core(const char *sense, const char *stuff, struc
        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;