Problem: contact_buf goes out of scope in if block, a call to
patch_contact_transport() may alter the msg->contacts cstring pointers.
Further down within function, a call to copy_hdrs_wr() will attempt to
copy the data from contact_buf, however contact_buf is out of scope.

Fix: Moving contact_buf outside of if block into the function scope.


int _trans_layer::set_trsp_socket(sip_msg* msg, const cstring&
next_trsp,
@@ -267,12 +268,11 @@
     sip_msg* req = t->msg;
     assert(req);

+    vector<string> contact_buf(msg->contacts.size());
     trsp_socket* local_socket = req->local_socket;
     if(!local_socket->is_opt_set(trsp_socket::no_transport_in_contact))
{
            cstring trsp(local_socket->get_transport());

-           // patch Contact-HF
-           vector<string> contact_buf(msg->contacts.size());
            vector<string>::iterator contact_buf_it =
contact_buf.begin();

            for(list<sip_header*>::iterator contact_it =
msg->contacts.begin();


Kind Regards,
Joseph Stusick
Manager - Product Development
Appia Communications, Inc.
231.929.0970 x186 | cell 231.883.5454 (EST)

_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to