Browse code

core: parse main headers after updating msg buffer

- same group of headers as for the case of receiving the message
- applies for msg_apply_changes() as well
- related to GH #2877

(cherry picked from commit d5c1b4693b6e47b4123b5f9417b5fd88d4dafd1f)
(cherry picked from commit 992c5a349454e40c87c8918283ffde7302da9d8e)

Daniel-Constantin Mierla authored on 13/10/2021 17:16:06
Showing 1 changed files
... ...
@@ -3315,7 +3315,13 @@ int sip_msg_update_buffer(sip_msg_t *msg, str *obuf)
3315 3315
 		 * valid/safe for config */
3316 3316
 		return 0;
3317 3317
 	}
3318
-
3318
+	if(parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F, 0) < 0) {
3319
+		LM_ERR("parsing main headers of new sip message failed [[%.*s]]\n",
3320
+				msg->len, msg->buf);
3321
+		/* exit config execution - sip_msg_t structure is no longer
3322
+		 * valid/safe for config */
3323
+		return 0;
3324
+	}
3319 3325
 	return 1;
3320 3326
 }
3321 3327