Module: kamailio
Branch: master
Commit: 49217fb14e7cc5794c8a0a2774c33337c33438ab
URL:
https://github.com/kamailio/kamailio/commit/49217fb14e7cc5794c8a0a2774c3333…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-10T11:19:19+02:00
carrierroute: safety checks inside avp_name_fixup
- reported by GH #1210
---
Modified: src/modules/carrierroute/cr_fixup.c
---
Diff:
https://github.com/kamailio/kamailio/commit/49217fb14e7cc5794c8a0a2774c3333…
Patch:
https://github.com/kamailio/kamailio/commit/49217fb14e7cc5794c8a0a2774c3333…
---
diff --git a/src/modules/carrierroute/cr_fixup.c b/src/modules/carrierroute/cr_fixup.c
index ac363e9e9e..92c751047c 100644
--- a/src/modules/carrierroute/cr_fixup.c
+++ b/src/modules/carrierroute/cr_fixup.c
@@ -184,6 +184,11 @@ static int avp_name_fixup(void ** param) {
LM_ERR("could not fixup parameter");
return -1;
}
+ if(*param==NULL || ((gparam_p)(*param))->v.pve==NULL
+ || ((gparam_p)(*param))->v.pve->spec==NULL) {
+ LM_ERR("invalid AVP type definition\n");
+ return -1;
+ }
if (((gparam_p)(*param))->v.pve->spec->type == PVT_AVP &&
((gparam_p)(*param))->v.pve->spec->pvp.pvn.u.isname.name.s.len == 0
&&
((gparam_p)(*param))->v.pve->spec->pvp.pvn.u.isname.name.s.s == 0) {