Skip to content

Commit

Permalink
sipdump: safety check for received address
Browse files Browse the repository at this point in the history
(cherry picked from commit f6a0533)
  • Loading branch information
miconda committed Dec 8, 2017
1 parent b869872 commit a0bbb14
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/sipdump/sipdump_mod.c
Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit a0bbb14

Please sign in to comment.