]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4055 --resolve this was caused by corrupted db data, this patch will prevent it...
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 29 Mar 2012 15:07:34 +0000 (10:07 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 29 Mar 2012 15:07:34 +0000 (10:07 -0500)
src/mod/endpoints/mod_sofia/sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index 7ebb03851e3e55e998cc27c5c3507a379b05ecb4..b66288ecfb8f48a782268206b6769a4ed1da4ab6 100644 (file)
@@ -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++;
        }
index c553119360656fc1914d1a81891aa696f088c25d..fc70c2d52178af07db2bd528c27761ebce555871 100644 (file)
@@ -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);