avoiding segfault
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6016 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
b6c408a9e3
commit
603463d126
|
@ -1774,7 +1774,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
|||
|
||||
#define check_decode(_var, _session) do { \
|
||||
assert(_session); \
|
||||
if (strchr(_var, '%')) { \
|
||||
if (!switch_strlen_zero(_var) && strchr(_var, '%')) { \
|
||||
char *tmp = switch_core_session_strdup(_session, _var); \
|
||||
switch_url_decode(tmp); \
|
||||
_var = tmp; \
|
||||
|
@ -1797,6 +1797,14 @@ const char *_url_set_chanvars(switch_core_session_t *session, url_t *url, const
|
|||
port = url->url_port;
|
||||
}
|
||||
|
||||
if (switch_strlen_zero(user)) {
|
||||
user = "nobody";
|
||||
}
|
||||
|
||||
if (switch_strlen_zero(host)) {
|
||||
host = "nowhere";
|
||||
}
|
||||
|
||||
check_decode(user, session);
|
||||
|
||||
if (user) {
|
||||
|
|
Loading…
Reference in New Issue