From 2d6893261e87b436cf681f06891488fd8eac8fa1 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 9 Feb 2008 09:46:48 +0000 Subject: [PATCH] - fixed possible crash if additional headers are passed, but no message body. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@706 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/plug-in/sipctrl/SipCtrlInterface.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/plug-in/sipctrl/SipCtrlInterface.cpp b/core/plug-in/sipctrl/SipCtrlInterface.cpp index 41fb467f..d21e696a 100644 --- a/core/plug-in/sipctrl/SipCtrlInterface.cpp +++ b/core/plug-in/sipctrl/SipCtrlInterface.cpp @@ -296,12 +296,16 @@ int SipCtrlInterface::send(const AmSipReply &rep) } char* hdrs_buf = NULL; + char* c = hdrs_buf; + if (hdrs_len) { - hdrs_buf = new char[hdrs_len]; - char* c = hdrs_buf; + c = hdrs_buf = new char[hdrs_len]; copy_hdrs_wr(&c,msg.hdrs); - content_type_wr(&c,stl2cstr(rep.content_type)); + + if(!rep.body.empty()) { + content_type_wr(&c,stl2cstr(rep.content_type)); + } } int ret = tl->send_reply(get_trans_bucket(h),(sip_trans*)t,