Browse code

textops: check for msg headers field in case is used for non-sip traffic

(cherry picked from commit 48200f3e9ca9f5e5a05de440eefc23f7265b5268)

Daniel-Constantin Mierla authored on 28/04/2021 13:57:05
Showing 1 changed files
... ...
@@ -3401,7 +3401,7 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2,
3401 3401
 	int len;
3402 3402
 	str s0;
3403 3403
 
3404
-	if (parse_headers(msg, HDR_EOH_F, 0) == -1) {
3404
+	if ((parse_headers(msg, HDR_EOH_F, 0) == -1) || (msg->headers == NULL)) {
3405 3405
 		LM_ERR("error while parsing message\n");
3406 3406
 		return -1;
3407 3407
 	}