Skip to content

Commit

Permalink
textopsx: proper check for null value inside ki_modify_hf()
Browse files Browse the repository at this point in the history
(cherry picked from commit 5d813bb)
  • Loading branch information
miconda committed Dec 8, 2017
1 parent e1cee88 commit 68055f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/modules/textopsx/textopsx.c
Expand Up @@ -1183,7 +1183,7 @@ static int ki_modify_hf(sip_msg_t *msg, str *hexp, str *val,
p1 = NULL;
goto error;
}
if(val && val->s>=0) {
if(val && val->s!=0 && val->len>0) {
s2 = as_asciiz(val);
p2 = s2;
if(fixf(&p2, 2)!=0) {
Expand All @@ -1202,7 +1202,6 @@ static int ki_modify_hf(sip_msg_t *msg, str *hexp, str *val,
return ret;

error:
if(p2!=NULL) fixup_free_hname_str(&p2, 2);
if(p1!=NULL) fixup_free_hname_str(&p1, 1);
if(s2!=NULL) pkg_free(s2);
if(s1!=NULL) pkg_free(s1);
Expand Down

0 comments on commit 68055f3

Please sign in to comment.