[sr-dev] git:master:4598f0a0: core: added parser mode check

Daniel-Constantin Mierla miconda at gmail.com
Tue Aug 23 14:05:26 CEST 2022


Module: kamailio
Branch: master
Commit: 4598f0a0df90ad81e192be55a89fbd5cca52a40e
URL: https://github.com/kamailio/kamailio/commit/4598f0a0df90ad81e192be55a89fbd5cca52a40e

Author: korayvt <koray.vatansever at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-08-23T14:05:19+02:00

core: added parser mode check

---

Modified: src/core/parser/msg_parser.c

---

Diff:  https://github.com/kamailio/kamailio/commit/4598f0a0df90ad81e192be55a89fbd5cca52a40e.diff
Patch: https://github.com/kamailio/kamailio/commit/4598f0a0df90ad81e192be55a89fbd5cca52a40e.patch

---

diff --git a/src/core/parser/msg_parser.c b/src/core/parser/msg_parser.c
index 6455c9e5393..7a3855531ed 100644
--- a/src/core/parser/msg_parser.c
+++ b/src/core/parser/msg_parser.c
@@ -623,9 +623,11 @@ int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int
 
 skip:
 	msg->unparsed=tmp;
-	if(msg->headers==NULL) {
-		/* nothing parsed - invalid input sip message */
-		goto error1;
+	if(ksr_sip_parser_mode & KSR_SIP_PARSER_MODE_STRICT) {
+		if(msg->headers==NULL) {
+			/* nothing parsed - invalid input sip message */
+			goto error1;
+		}
 	}
 	/* restore original flags */
 	msg->parsed_flag |= orig_flag;




More information about the sr-dev mailing list