From 48200f3e9ca9f5e5a05de440eefc23f7265b5268 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Wed, 28 Apr 2021 15:57:05 +0200 Subject: [PATCH] textops: check for msg headers field in case is used for non-sip traffic --- src/modules/textops/textops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/textops/textops.c b/src/modules/textops/textops.c index 3d90e97a900..29989060519 100644 --- a/src/modules/textops/textops.c +++ b/src/modules/textops/textops.c @@ -3401,7 +3401,7 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2, int len; str s0; - if (parse_headers(msg, HDR_EOH_F, 0) == -1) { + if ((parse_headers(msg, HDR_EOH_F, 0) == -1) || (msg->headers == NULL)) { LM_ERR("error while parsing message\n"); return -1; }