Browse code

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

Raphael Coeffic authored on 11/03/2011 22:52:36
Showing 1 changed files
... ...
@@ -983,7 +983,7 @@ int _trans_layer::cancel(trans_ticket* tt)
983 983
 
984 984
     // Allocate new message
985 985
     sip_msg* p_msg = new sip_msg();
986
-    p_msg->buf = new char[request_len];
986
+    p_msg->buf = new char[request_len+1];
987 987
     p_msg->len = request_len;
988 988
 
989 989
     // generate it
... ...
@@ -1001,6 +1001,7 @@ int _trans_layer::cancel(trans_ticket* tt)
1001 1001
 
1002 1002
     *c++ = CR;
1003 1003
     *c++ = LF;
1004
+    *c   = '\0';
1004 1005
 
1005 1006
     // and parse it
1006 1007
     char* err_msg=0;