Module: kamailio
Branch: master
Commit: b1eb0928f8e68a697eccda3e75504eb2263cb95b
URL:
https://github.com/kamailio/kamailio/commit/b1eb0928f8e68a697eccda3e75504eb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-05-04T10:02:18+02:00
ims_ipsec_pcscf: safety check for pcontact search result
---
Modified: src/modules/ims_ipsec_pcscf/cmd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/b1eb0928f8e68a697eccda3e75504eb…
Patch:
https://github.com/kamailio/kamailio/commit/b1eb0928f8e68a697eccda3e75504eb…
---
diff --git a/src/modules/ims_ipsec_pcscf/cmd.c b/src/modules/ims_ipsec_pcscf/cmd.c
index 5013087c02..0651d4226f 100644
--- a/src/modules/ims_ipsec_pcscf/cmd.c
+++ b/src/modules/ims_ipsec_pcscf/cmd.c
@@ -667,7 +667,7 @@ int ipsec_create(struct sip_msg* m, udomain_t* d, int _cflags)
ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot);
- if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0) {
+ if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0 || pcontact==NULL) {
LM_ERR("Contact doesn't exist\n");
goto cleanup;
}
@@ -810,7 +810,8 @@ int ipsec_forward(struct sip_msg* m, udomain_t* d, int _cflags)
ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot);
- if (ul.get_pcontact(d, &ci, &pcontact, _cflags & IPSEC_REVERSE_SEARCH) !=
0) {
+ if (ul.get_pcontact(d, &ci, &pcontact, _cflags & IPSEC_REVERSE_SEARCH) !=
0
+ || pcontact==NULL) {
LM_ERR("Contact doesn't exist\n");
goto cleanup;
}
@@ -967,7 +968,7 @@ int ipsec_destroy(struct sip_msg* m, udomain_t* d)
ul.lock_udomain(d, &ci.via_host, ci.via_port, ci.via_prot);
- if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0) {
+ if (ul.get_pcontact(d, &ci, &pcontact, 0) != 0 || pcontact==NULL) {
LM_ERR("Contact doesn't exist\n");
goto cleanup;
}