mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 22:45:49 +00:00
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
This commit is contained in:
@@ -615,7 +615,7 @@ static int notify_endpoint(void *obj)
|
||||
|
||||
aors = ast_strdupa(data->endpoint->aors);
|
||||
|
||||
while ((aor_name = strsep(&aors, ","))) {
|
||||
while ((aor_name = ast_strip(strsep(&aors, ",")))) {
|
||||
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);
|
||||
|
Reference in New Issue
Block a user