Module: kamailio
Branch: master
Commit: f33abd5e2d5978ba9e6e8a48066b0daff70c0b3b
URL:
https://github.com/kamailio/kamailio/commit/f33abd5e2d5978ba9e6e8a48066b0da…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-04-08T12:05:07+02:00
nat_traversal: check parameter for send_keepalive()
---
Modified: src/modules/nat_traversal/nat_traversal.c
---
Diff:
https://github.com/kamailio/kamailio/commit/f33abd5e2d5978ba9e6e8a48066b0da…
Patch:
https://github.com/kamailio/kamailio/commit/f33abd5e2d5978ba9e6e8a48066b0da…
---
diff --git a/src/modules/nat_traversal/nat_traversal.c
b/src/modules/nat_traversal/nat_traversal.c
index 27dbf2736d..4cfe8d4018 100644
--- a/src/modules/nat_traversal/nat_traversal.c
+++ b/src/modules/nat_traversal/nat_traversal.c
@@ -1554,6 +1554,11 @@ static void send_keepalive(NAT_Contact *contact)
unsigned short lport;
char lproto;
+ if(contact==NULL || contact->socket==NULL) {
+ LM_ERR("invalid parameters\n");
+ return;
+ }
+
if(keepalive_params.from == NULL) {
if(contact->socket != last_socket) {
memcpy(from_ip, contact->socket->address_str.s,