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)
(cherry picked from commit 49f3ec66c9e187584f403ca19e3b436abd20376a)

Daniel-Constantin Mierla authored on 13/10/2021 17:16:06
Showing 1 changed files
... ...
@@ -3284,7 +3284,13 @@ int sip_msg_update_buffer(sip_msg_t *msg, str *obuf)
3284 3284
 		 * valid/safe for config */
3285 3285
 		return 0;
3286 3286
 	}
3287
-
3287
+	if(parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F, 0) < 0) {
3288
+		LM_ERR("parsing main headers of new sip message failed [[%.*s]]\n",
3289
+				msg->len, msg->buf);
3290
+		/* exit config execution - sip_msg_t structure is no longer
3291
+		 * valid/safe for config */
3292
+		return 0;
3293
+	}
3288 3294
 	return 1;
3289 3295
 }
3290 3296