Module: kamailio Branch: master Commit: 5d813bb3abd1a9a0ee080bf67db2f5502772a3be URL: https://github.com/kamailio/kamailio/commit/5d813bb3abd1a9a0ee080bf67db2f550...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2017-12-08T09:31:21+01:00
textopsx: proper check for null value inside ki_modify_hf()
---
Modified: src/modules/textopsx/textopsx.c
---
Diff: https://github.com/kamailio/kamailio/commit/5d813bb3abd1a9a0ee080bf67db2f550... Patch: https://github.com/kamailio/kamailio/commit/5d813bb3abd1a9a0ee080bf67db2f550...
---
diff --git a/src/modules/textopsx/textopsx.c b/src/modules/textopsx/textopsx.c index a6d7abc65e..24bdf0c84f 100644 --- a/src/modules/textopsx/textopsx.c +++ b/src/modules/textopsx/textopsx.c @@ -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) { @@ -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);