Skip to content

Commit

Permalink
core: improve to header check guards, str consists of length and pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
henningw committed May 7, 2018
1 parent 6a15202 commit 281a6c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/msg_translator.c
Expand Up @@ -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="*/;
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 281a6c6

Please sign in to comment.