diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index 7ebb03851e..b66288ecfb 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -5217,6 +5217,8 @@ char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup) { char *url = NULL, *e; + switch_assert(buf); + while(*buf == ' ') { buf++; } diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index c553119360..fc70c2d521 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1851,6 +1851,11 @@ static void _send_presence_notify(sofia_profile_t *profile, char *contact_str, *contact, *user_via = NULL; char *route_uri = NULL, *o_contact_dup = NULL, *tmp, *to_uri, *dcs = NULL; const char *tp; + + if (zstr(full_to) || zstr(full_from) || zstr(o_contact) || zstr(expires) || zstr(ct) || zstr(pl)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MISSING DATA TO SEND NOTIFY.\n"); + return; + } tmp = (char *)o_contact; o_contact_dup = sofia_glue_get_url_from_contact(tmp, 1);