[sr-dev] git:master:179a6e69: tm: terminate local uac buffers with 0

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 8 10:10:43 CEST 2017


Module: kamailio
Branch: master
Commit: 179a6e699a1021efa55d1ea097ceeb7a12575cc5
URL: https://github.com/kamailio/kamailio/commit/179a6e699a1021efa55d1ea097ceeb7a12575cc5

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2017-08-08T10:08:10+02:00

tm: terminate local uac buffers with 0

- received message buffer is terminated with 0 and many functions expect
  that, so use of them in event_route[tm:local-request] may have ended
  up in wrong behavior

---

Modified: src/modules/tm/t_msgbuilder.c

---

Diff:  https://github.com/kamailio/kamailio/commit/179a6e699a1021efa55d1ea097ceeb7a12575cc5.diff
Patch: https://github.com/kamailio/kamailio/commit/179a6e699a1021efa55d1ea097ceeb7a12575cc5.patch

---

diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c
index c4ab254076..feb7513bfd 100644
--- a/src/modules/tm/t_msgbuilder.c
+++ b/src/modules/tm/t_msgbuilder.c
@@ -1633,6 +1633,8 @@ char* build_uac_req(str* method, str* headers, str* body, dlg_t* dialog,
 	assert(w-buf == *len);
 #endif
 
+	memapp(w, "\0", 1);
+
 	pkg_free(via.s);
 	return buf;
 




More information about the sr-dev mailing list