Fix segfault when checking peer addresses

This segfault would occur when a peer with a static IP address (e.i. not a
hostname resolved via DNS) is read, and any other peer after that.
This commit is contained in:
Matthias Schiffer 2014-11-15 16:24:25 +01:00
parent ed121da8eb
commit 89bf354b91

View file

@ -456,7 +456,7 @@ static fastd_peer_t * find_key(const uint8_t key[PUBLICKEYBYTES], const fastd_pe
continue;
}
if (fastd_peer_owns_address(peer, address)) {
if (address && fastd_peer_owns_address(peer, address)) {
errno = EPERM;
return NULL;
}