Module: kamailio
Branch: 5.1
Commit: a0bbb14169eb82ffe5936c0fe73a5cc943407e83
URL:
https://github.com/kamailio/kamailio/commit/a0bbb14169eb82ffe5936c0fe73a5cc…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-12-08T16:55:42+01:00
sipdump: safety check for received address
(cherry picked from commit f6a05336de65bb929854c5843e5aa821901b63eb)
---
Modified: src/modules/sipdump/sipdump_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/a0bbb14169eb82ffe5936c0fe73a5cc…
Patch:
https://github.com/kamailio/kamailio/commit/a0bbb14169eb82ffe5936c0fe73a5cc…
---
diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c
index c95e0b091a..3247d71a70 100644
--- a/src/modules/sipdump/sipdump_mod.c
+++ b/src/modules/sipdump/sipdump_mod.c
@@ -229,7 +229,8 @@ int ki_sipdump_send(sip_msg_t *msg, str *stag)
}
sdi.af.len = 4;
- if(msg->rcv.bind_address->address.af==AF_INET6) {
+ if(msg->rcv.bind_address!=NULL
+ && msg->rcv.bind_address->address.af==AF_INET6) {
sdi.af.s = "ipv6";
} else {
sdi.af.s = "ipv4";
@@ -298,7 +299,8 @@ int sipdump_msg_received(sr_event_param_t *evp)
sdi.dst_port = (int)evp->rcv->bind_address->port_no;
}
sdi.af.len = 4;
- if(evp->rcv->bind_address->address.af==AF_INET6) {
+ if(evp->rcv->bind_address!=NULL
+ && evp->rcv->bind_address->address.af==AF_INET6) {
sdi.af.s = "ipv6";
} else {
sdi.af.s = "ipv4";