fixed segfault when sourceip in stroke message is NULL
authorMartin Willi <martin@strongswan.org>
Mon, 6 Aug 2007 12:35:28 +0000 (12:35 -0000)
committerMartin Willi <martin@strongswan.org>
Mon, 6 Aug 2007 12:35:28 +0000 (12:35 -0000)
src/charon/control/interfaces/stroke_interface.c

index 3d4e637..71d4444 100755 (executable)
@@ -336,11 +336,11 @@ static void stroke_add_conn(stroke_msg_t *msg, FILE *out)
                goto destroy_ids;
        }
        
-       if (msg->add_conn.me.virtual_ip)
+       if (msg->add_conn.me.virtual_ip && msg->add_conn.me.sourceip)
        {
                my_vip = host_create_from_string(msg->add_conn.me.sourceip, 0);
        }
-       if (msg->add_conn.other.virtual_ip)
+       if (msg->add_conn.other.virtual_ip && msg->add_conn.other.sourceip)
        {
                other_vip = host_create_from_string(msg->add_conn.other.sourceip, 0);
        }