From: Anthony Minessale Date: Wed, 17 Jul 2013 14:21:28 +0000 (-0500) Subject: FS-5613 --resolve only alphanumeric plus - _ . are now allowed X-Git-Tag: v1.5.3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f52531630eb659a703eda0478515cfc52f03bff;p=thirdparty%2Ffreeswitch.git FS-5613 --resolve only alphanumeric plus - _ . are now allowed --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index ba5e1694b3..4263b84109 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2946,8 +2946,9 @@ static void parse_gateways(sofia_profile_t *profile, switch_xml_t gateways_tag) sofia_gateway_t *gateway; char *pkey = switch_mprintf("%s::%s", profile->name, name); - if (zstr(name)) { - name = "anonymous"; + if (zstr(name) || switch_regex_match(name, "^[\\w\\.\\-\\_]+$") != SWITCH_STATUS_SUCCESS) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Ignoring invalid name '%s'\n", name ? name : "NULL"); + goto skip; } switch_mutex_lock(mod_sofia_globals.hash_mutex);