Module: kamailio
Branch: master
Commit: 3e969a5b4d9a75d082f7d59b0fa1dc6362391675
URL:
https://github.com/kamailio/kamailio/commit/3e969a5b4d9a75d082f7d59b0fa1dc6…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-05-08T18:01:13+02:00
sipdump: safety check for local socket pointer
- use generic address is not set
---
Modified: src/modules/sipdump/sipdump_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/3e969a5b4d9a75d082f7d59b0fa1dc6…
Patch:
https://github.com/kamailio/kamailio/commit/3e969a5b4d9a75d082f7d59b0fa1dc6…
---
diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c
index ad867ff0ce..e61fea014d 100644
--- a/src/modules/sipdump/sipdump_mod.c
+++ b/src/modules/sipdump/sipdump_mod.c
@@ -433,8 +433,14 @@ int sipdump_msg_sent(sr_event_param_t *evp)
sdi.tag.s = "snd";
sdi.tag.len = 3;
- sdi.src_ip = evp->dst->send_sock->address_str;
- sdi.src_port = (int)evp->dst->send_sock->port_no;
+ if(evp->dst->send_sock==NULL || evp->dst->send_sock->address_str.s==NULL)
{
+ sdi.src_ip.len = 7;
+ sdi.src_ip.s = "0.0.0.0";
+ sdi.src_port = 0;
+ } else {
+ sdi.src_ip = evp->dst->send_sock->address_str;
+ sdi.src_port = (int)evp->dst->send_sock->port_no;
+ }
su2ip_addr(&ip, &evp->dst->to);
sdi.dst_ip.len = ip_addr2sbufz(&ip, dstip_buf, IP_ADDR_MAX_STRZ_SIZE);
sdi.dst_ip.s = dstip_buf;