Module: kamailio Branch: master Commit: 5ce984913f54849b841675955f971b73b8d76eb5 URL: https://github.com/kamailio/kamailio/commit/5ce984913f54849b841675955f971b73b8d76eb5
Author: Daniel-Constantin Mierla <[email protected]> Committer: Daniel-Constantin Mierla <[email protected]> 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/5ce984913f54849b841675955f971b73b8d76eb5.diff Patch: https://github.com/kamailio/kamailio/commit/5ce984913f54849b841675955f971b73b8d76eb5.patch --- 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); _______________________________________________ Kamailio (SER) - Development Mailing List [email protected] https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
