[sr-dev] git:master:34b61d3f: tm: skip body operation on empty string for uac building

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 9 10:27:34 CEST 2021


Module: kamailio
Branch: master
Commit: 34b61d3f1d6b5a0d4425f8edfa69d707cfa058b7
URL: https://github.com/kamailio/kamailio/commit/34b61d3f1d6b5a0d4425f8edfa69d707cfa058b7

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-09-09T10:25:29+02:00

tm: skip body operation on empty string for uac building

---

Modified: src/modules/tm/t_msgbuilder.c

---

Diff:  https://github.com/kamailio/kamailio/commit/34b61d3f1d6b5a0d4425f8edfa69d707cfa058b7.diff
Patch: https://github.com/kamailio/kamailio/commit/34b61d3f1d6b5a0d4425f8edfa69d707cfa058b7.patch

---

diff --git a/src/modules/tm/t_msgbuilder.c b/src/modules/tm/t_msgbuilder.c
index ef9b45e246..27aaef9b5f 100644
--- a/src/modules/tm/t_msgbuilder.c
+++ b/src/modules/tm/t_msgbuilder.c
@@ -1637,7 +1637,7 @@ char* build_uac_req(str* method, str* headers, str* body, dlg_t* dialog,
 			memapp(w, CRLF, CRLF_LEN);
 	}
 	memapp(w, CRLF, CRLF_LEN);
-	if (body) memapp(w, body->s, body->len);
+	if (body && body->s && body->len>0) memapp(w, body->s, body->len);
 
 #ifdef EXTRA_DEBUG
 	assert(w-buf == *len);




More information about the sr-dev mailing list