Module: sems
Branch: master
Commit: 7058baf65882692c5dc8fe1ee2e9215270d648f0
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=7058baf65882692c5dc8fe1ee2e9215270d648f0

Author: Raphael Coeffic <[email protected]>
Committer: Raphael Coeffic <[email protected]>
Date:   Fri Mar 11 23:52:36 2011 +0100

b/f: cancel msg length & zero-termination.

---

 core/sip/trans_layer.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/core/sip/trans_layer.cpp b/core/sip/trans_layer.cpp
index 85fe929..cd15a31 100644
--- a/core/sip/trans_layer.cpp
+++ b/core/sip/trans_layer.cpp
@@ -983,7 +983,7 @@ int _trans_layer::cancel(trans_ticket* tt)
 
     // Allocate new message
     sip_msg* p_msg = new sip_msg();
-    p_msg->buf = new char[request_len];
+    p_msg->buf = new char[request_len+1];
     p_msg->len = request_len;
 
     // generate it
@@ -1001,6 +1001,7 @@ int _trans_layer::cancel(trans_ticket* tt)
 
     *c++ = CR;
     *c++ = LF;
+    *c   = '\0';
 
     // and parse it
     char* err_msg=0;

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

Reply via email to