Module: kamailio Branch: master Commit: 5ce984913f54849b841675955f971b73b8d76eb5 URL: https://github.com/kamailio/kamailio/commit/5ce984913f54849b841675955f971b73...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2019-04-17T15:40:47+02:00
app_mono: safety check for anchor lump
---
Modified: src/modules/app_mono/app_mono_api.c
---
Diff: https://github.com/kamailio/kamailio/commit/5ce984913f54849b841675955f971b73... Patch: https://github.com/kamailio/kamailio/commit/5ce984913f54849b841675955f971b73...
---
diff --git a/src/modules/app_mono/app_mono_api.c b/src/modules/app_mono/app_mono_api.c index efd17e8226..2343b1d922 100644 --- a/src/modules/app_mono/app_mono_api.c +++ b/src/modules/app_mono/app_mono_api.c @@ -778,7 +778,7 @@ static int sr_mono_hdr_append (MonoString *hv) hdr[txt.len] = '\0'; anchor = anchor_lump(env_M->msg, hf->name.s + hf->len - env_M->msg->buf, 0, 0); - if(insert_new_lump_before(anchor, hdr, txt.len, 0) == 0) + if((anchor==NULL) || (insert_new_lump_before(anchor, hdr, txt.len, 0) == 0)) { LM_ERR("can't insert lump\n"); pkg_free(hdr); @@ -873,7 +873,7 @@ static int sr_mono_hdr_insert (MonoString *hv) hdr[txt.len] = '\0'; anchor = anchor_lump(env_M->msg, hf->name.s + hf->len - env_M->msg->buf, 0, 0); - if(insert_new_lump_before(anchor, hdr, txt.len, 0) == 0) + if((anchor==NULL) || (insert_new_lump_before(anchor, hdr, txt.len, 0) == 0)) { LM_ERR("can't insert lump\n"); pkg_free(hdr);