Module: kamailio
Branch: master
Commit: 6968f1df9e9d3d66810df910d290f3d9368255fe
URL:
https://github.com/kamailio/kamailio/commit/6968f1df9e9d3d66810df910d290f3d…
Author: Riccardo Villa <riccardo.villa(a)netaxis.be>
Committer: Riccardo Villa <riccardo.villa(a)netaxis.be>
Date: 2021-02-24T09:52:59+01:00
ims_diameter_server: check response is not null before json conversion
---
Modified: src/modules/ims_diameter_server/ims_diameter_server.c
---
Diff:
https://github.com/kamailio/kamailio/commit/6968f1df9e9d3d66810df910d290f3d…
Patch:
https://github.com/kamailio/kamailio/commit/6968f1df9e9d3d66810df910d290f3d…
---
diff --git a/src/modules/ims_diameter_server/ims_diameter_server.c
b/src/modules/ims_diameter_server/ims_diameter_server.c
index c7fe941b00..62b8c3add8 100644
--- a/src/modules/ims_diameter_server/ims_diameter_server.c
+++ b/src/modules/ims_diameter_server/ims_diameter_server.c
@@ -322,7 +322,7 @@ int diameter_request(struct sip_msg * msg, char* peer, char* appid,
char* comman
} else {
resp = cdpb.AAASendRecvMessageToPeer(req, &s_peer);
LM_DBG("Successfully sent diameter\n");
- if (AAAmsg2json(resp, &responsejson) == 1) {
+ if (resp && AAAmsg2json(resp, &responsejson) == 1) {
return 1;
} else {
LM_ERR("Failed to convert response to JSON\n");
@@ -337,7 +337,7 @@ int diameter_request(struct sip_msg * msg, char* peer, char* appid,
char* comman
} else {
resp = cdpb.AAASendRecvMessage(req);
LM_DBG("Successfully sent diameter\n");
- if (AAAmsg2json(resp, &responsejson) == 1) {
+ if (resp && AAAmsg2json(resp, &responsejson) == 1) {
return 1;
} else {
LM_ERR("Failed to convert response to JSON\n");