Module: kamailio
Branch: master
Commit: c9845c330ec0ed323d6dd098a746a7374642f1c6
URL:
https://github.com/kamailio/kamailio/commit/c9845c330ec0ed323d6dd098a746a73…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2018-11-05T10:45:38+01:00
ims_diameter_server: safety check for diameter message parameter
- GH #1686
---
Modified: src/modules/ims_diameter_server/avp_helper.c
---
Diff:
https://github.com/kamailio/kamailio/commit/c9845c330ec0ed323d6dd098a746a73…
Patch:
https://github.com/kamailio/kamailio/commit/c9845c330ec0ed323d6dd098a746a73…
---
diff --git a/src/modules/ims_diameter_server/avp_helper.c
b/src/modules/ims_diameter_server/avp_helper.c
index 9f6b67cf2e..ab3974ac1f 100644
--- a/src/modules/ims_diameter_server/avp_helper.c
+++ b/src/modules/ims_diameter_server/avp_helper.c
@@ -200,6 +200,10 @@ int pv_get_request(struct sip_msg *msg, pv_param_t *param, pv_value_t
*res) {
*/
int diameterserver_add_avp(AAAMessage *m, char *d, int len, int avp_code, int flags, int
vendorid, int data_do, const char *func) {
AAA_AVP *avp;
+ if(m==NULL) {
+ LM_ERR("invalid diamemter message parameter\n");
+ return 0;
+ }
if (vendorid != 0) flags |= AAA_AVP_FLAG_VENDOR_SPECIFIC;
avp = cdpb.AAACreateAVP(avp_code, flags, vendorid, d, len, data_do);
if (!avp) {