[sr-dev] git:master:48200f3e: textops: check for msg headers field in case is used for non-sip traffic

Daniel-Constantin Mierla miconda at gmail.com
Wed Apr 28 16:07:27 CEST 2021


Module: kamailio
Branch: master
Commit: 48200f3e9ca9f5e5a05de440eefc23f7265b5268
URL: https://github.com/kamailio/kamailio/commit/48200f3e9ca9f5e5a05de440eefc23f7265b5268

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-04-28T15:57:05+02:00

textops: check for msg headers field in case is used for non-sip traffic

---

Modified: src/modules/textops/textops.c

---

Diff:  https://github.com/kamailio/kamailio/commit/48200f3e9ca9f5e5a05de440eefc23f7265b5268.diff
Patch: https://github.com/kamailio/kamailio/commit/48200f3e9ca9f5e5a05de440eefc23f7265b5268.patch

---

diff --git a/src/modules/textops/textops.c b/src/modules/textops/textops.c
index 3d90e97a90..2998906051 100644
--- a/src/modules/textops/textops.c
+++ b/src/modules/textops/textops.c
@@ -3401,7 +3401,7 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2,
 	int len;
 	str s0;
 
-	if (parse_headers(msg, HDR_EOH_F, 0) == -1) {
+	if ((parse_headers(msg, HDR_EOH_F, 0) == -1) || (msg->headers == NULL)) {
 		LM_ERR("error while parsing message\n");
 		return -1;
 	}




More information about the sr-dev mailing list