diff options
Diffstat (limited to 'main/kamailio/core-improve-to-header-check-guards.patch')
-rw-r--r-- | main/kamailio/core-improve-to-header-check-guards.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/main/kamailio/core-improve-to-header-check-guards.patch b/main/kamailio/core-improve-to-header-check-guards.patch new file mode 100644 index 0000000000..543ed12222 --- /dev/null +++ b/main/kamailio/core-improve-to-header-check-guards.patch @@ -0,0 +1,32 @@ +From 281a6c6b6eaaf30058b603325e8ded20b99e1456 Mon Sep 17 00:00:00 2001 +From: Henning Westerholt <hw@kamailio.org> +Date: Mon, 7 May 2018 09:36:53 +0200 +Subject: [PATCH] core: improve to header check guards, str consists of length + and pointer + +--- + msg_translator.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/core/msg_translator.c b/src/core/msg_translator.c +index 22122768a1..4dd648e874 100644 +--- a/msg_translator.c ++++ b/msg_translator.c +@@ -2369,7 +2369,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag, + case HDR_TO_T: + if (new_tag && new_tag->len) { + to_tag=get_to(msg)->tag_value; +- if ( to_tag.len || to_tag.s ) ++ if ( to_tag.len && to_tag.s ) + len+=new_tag->len-to_tag.len; + else + len+=new_tag->len+TOTAG_TOKEN_LEN/*";tag="*/; +@@ -2497,7 +2497,7 @@ char * build_res_buf_from_sip_req( unsigned int code, str *text ,str *new_tag, + break; + case HDR_TO_T: + if (new_tag && new_tag->len){ +- if (to_tag.s ) { /* replacement */ ++ if (to_tag.len && to_tag.s) { /* replacement */ + /* before to-tag */ + append_str( p, hdr->name.s, to_tag.s-hdr->name.s); + /* to tag replacement */ |