aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c b/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c
index 6d06ee179..da7ae472d 100644
--- a/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c
+++ b/src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c
@@ -1831,7 +1831,7 @@ METHOD(enumerator_t, enumerate_subnets, bool,
for (; this->current < this->buf + this->len;
this->current += rtm->rtm_msglen)
{
- struct sockaddr *netmask;
+ struct sockaddr *netmask = NULL;
uint8_t netbits = 0;
rtm = (struct rt_msghdr*)this->current;
@@ -1864,7 +1864,7 @@ METHOD(enumerator_t, enumerate_subnets, bool,
this->ifname = strndup(sdl->sdl_data, sdl->sdl_nlen);
}
}
- if (this->net)
+ if (this->net && netmask)
{
netbits = sockaddr_to_netmask(netmask, this->net);
}