diff options
author | George Joseph <george.joseph@fairview5.com> | 2016-03-06 13:38:41 -0700 |
---|---|---|
committer | George Joseph <george.joseph@fairview5.com> | 2016-03-07 13:16:41 -0600 |
commit | d2eb65f71e9347c15d469579bbb20c47501d924b (patch) | |
tree | 7146e406d5ab4a30eebbf6b62161a9d219f98cca /channels/pjsip | |
parent | ee5a9442a295eedf05b998ef1b5c101832d6673f (diff) |
res_pjsip: Strip spaces from items parsed from comma-separated lists
Configurations like "aors = a, b, c" were either ignoring everything after "a"
or trying to look up " b". Same for mailboxes, ciphers, contacts and a few
others.
To fix, all the strsep(©, ",") calls have been wrapped in ast_strip. To
facilitate this, ast_strip, ast_skip_blanks and ast_skip_nonblanks were
updated to handle null pointers.
In some cases, an ast_strlen_zero() test was added to skip consecutive commas.
There was also an attempt to ast_free an ast_strdupa'd string in
ast_sip_for_each_aor which was causing a SEGV. I removed it.
Although this issue was reported for realtime, the issue was in the res_pjsip
modules so all config mechanisms were affected.
ASTERISK-25829 #close
Reported-by: Mateusz Kowalski
Change-Id: I0b22a2cf22a7c1c50d4ecacbfa540155bec0e7a2
Diffstat (limited to 'channels/pjsip')
-rw-r--r-- | channels/pjsip/dialplan_functions.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/pjsip/dialplan_functions.c b/channels/pjsip/dialplan_functions.c index b86cfad53..1c0899732 100644 --- a/channels/pjsip/dialplan_functions.c +++ b/channels/pjsip/dialplan_functions.c @@ -819,7 +819,7 @@ int pjsip_acf_dial_contacts_read(struct ast_channel *chan, const char *cmd, char return -1; } - while ((aor_name = strsep(&rest, ","))) { + while ((aor_name = ast_strip(strsep(&rest, ",")))) { RAII_VAR(struct ast_sip_aor *, aor, ast_sip_location_retrieve_aor(aor_name), ao2_cleanup); RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup); struct ao2_iterator it_contacts; |