Module: kamailio
Branch: 4.2
Commit: e71012814800462519b9040e82c892dfa39bf817
URL:
https://github.com/kamailio/kamailio/commit/e71012814800462519b9040e82c892d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-05-19T09:34:36+02:00
textops: safety check to know there is a string to add via lump
(cherry picked from commit ca220afe0f738f2353d16c96dd16ab279ffdcf74)
---
Modified: modules/textops/textops.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e71012814800462519b9040e82c892d…
Patch:
https://github.com/kamailio/kamailio/commit/e71012814800462519b9040e82c892d…
---
diff --git a/modules/textops/textops.c b/modules/textops/textops.c
index a945937..fa8874f 100644
--- a/modules/textops/textops.c
+++ b/modules/textops/textops.c
@@ -2126,6 +2126,11 @@ int add_hf_helper(struct sip_msg* msg, str *str1, str *str2,
len=s0.len;
if (str2) len+= str2->len + REQ_LINE(msg).uri.len;
+ if(len==0) {
+ LM_INFO("nothing to add\n");
+ return -1;
+ }
+
s = (char*)pkg_malloc(len);
if (!s) {
LM_ERR("no pkg memory left\n");