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
This commit is contained in:
Sean Bright 2020-07-13 16:42:40 -04:00 committed by George Joseph
parent f1d7de121f
commit c3588d9c0b
1 changed files with 1 additions and 1 deletions

View File

@ -578,7 +578,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;