]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix seg on subscribe with no contact host
authorMichael Jerris <mike@jerris.com>
Tue, 21 Sep 2010 19:31:36 +0000 (14:31 -0500)
committerBrian West <brian@freeswitch.org>
Tue, 21 Sep 2010 19:31:36 +0000 (14:31 -0500)
src/mod/endpoints/mod_sofia/sofia_presence.c

index 5eb71b37e9f4adc68b9934eb6d94f40b4c49b83d..333f31b91d6de4c4100ac99497d1a26bb93b902e 100644 (file)
@@ -1983,12 +1983,20 @@ void sofia_presence_handle_sip_i_subscribe(int status,
                        is_nat = NULL;
                }
 
+               if (zstr(contact_host)) {
+                       is_nat = "No contact host";
+               }
+
                if (is_nat) {
                        contact_host = network_ip;
                        switch_snprintf(new_port, sizeof(new_port), ":%d", network_port);
                        port = NULL;
                }
 
+               if (zstr(contact_host)) {
+                       nua_respond(nh, 481, "INVALID SUBSCRIPTION", TAG_END());
+                       return;
+               }
 
                if (port) {
                        switch_snprintf(new_port, sizeof(new_port), ":%s", port);