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

Daniel-Constantin Mierla authored on 13/10/2021 17:16:06
Showing 1 changed files
... ...
@@ -3328,7 +3328,13 @@ int sip_msg_update_buffer(sip_msg_t *msg, str *obuf)
3328 3328
 		 * valid/safe for config */
3329 3329
 		return 0;
3330 3330
 	}
3331
-
3331
+	if(parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F, 0) < 0) {
3332
+		LM_ERR("parsing main headers of new sip message failed [[%.*s]]\n",
3333
+				msg->len, msg->buf);
3334
+		/* exit config execution - sip_msg_t structure is no longer
3335
+		 * valid/safe for config */
3336
+		return 0;
3337
+	}
3332 3338
 	return 1;
3333 3339
 }
3334 3340