[sr-dev] git:5.5:33db4ffc: tm: lw parser - fix matching To header in lw_get_hf_name()

Daniel-Constantin Mierla miconda at gmail.com
Wed May 5 18:57:27 CEST 2021


Module: kamailio
Branch: 5.5
Commit: 33db4ffc558b7a9d4c291c929b9e73b3cf8b16f0
URL: https://github.com/kamailio/kamailio/commit/33db4ffc558b7a9d4c291c929b9e73b3cf8b16f0

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

tm: lw parser - fix matching To header in lw_get_hf_name()

(cherry picked from commit 4ab6e05df56afb7802a2cd125e89b9282a1c6c85)

---

Modified: src/modules/tm/lw_parser.c

---

Diff:  https://github.com/kamailio/kamailio/commit/33db4ffc558b7a9d4c291c929b9e73b3cf8b16f0.diff
Patch: https://github.com/kamailio/kamailio/commit/33db4ffc558b7a9d4c291c929b9e73b3cf8b16f0.patch

---

diff --git a/src/modules/tm/lw_parser.c b/src/modules/tm/lw_parser.c
index d13ec58311..6f48304f53 100644
--- a/src/modules/tm/lw_parser.c
+++ b/src/modules/tm/lw_parser.c
@@ -188,9 +188,11 @@ char *lw_get_hf_name(char *begin, char *end, enum _hdr_types_t *type)
 
 				case 't': /* To */
 					if(LOWER_BYTE(*(p + 1)) == 'o') {
-						p += 2;
-						*type = HDR_TO_T;
-						break;
+						if((*(p + 2) == ' ') || (*(p + 2) == ':')) {
+							p += 2;
+							*type = HDR_TO_T;
+							break;
+						}
 					}
 					if((*(p + 1) == ' ') || (*(p + 1) == ':')) {
 						p++;




More information about the sr-dev mailing list