]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Strip spaces from items parsed from comma-separated lists 59/2359/4
authorGeorge Joseph <george.joseph@fairview5.com>
Sun, 6 Mar 2016 20:38:41 +0000 (13:38 -0700)
committerGeorge Joseph <george.joseph@fairview5.com>
Mon, 7 Mar 2016 19:16:41 +0000 (13:16 -0600)
commitd2eb65f71e9347c15d469579bbb20c47501d924b
tree7146e406d5ab4a30eebbf6b62161a9d219f98cca
parentee5a9442a295eedf05b998ef1b5c101832d6673f
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(&copy, ",") 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
12 files changed:
channels/pjsip/dialplan_functions.c
include/asterisk/strings.h
res/res_pjsip/config_transport.c
res/res_pjsip/location.c
res/res_pjsip/pjsip_configuration.c
res/res_pjsip/pjsip_options.c
res/res_pjsip_endpoint_identifier_ip.c
res/res_pjsip_mwi.c
res/res_pjsip_notify.c
res/res_pjsip_path.c
res/res_pjsip_pubsub.c
res/res_pjsip_registrar.c