resolve: fix member access within null pointer

Fixes #10333.
This commit is contained in:
Yu Watanabe 2018-10-11 18:36:18 +09:00
parent f55f2dce05
commit 25270cf3db
1 changed files with 2 additions and 2 deletions

View File

@ -1051,9 +1051,9 @@ int manager_send(
log_debug("Sending %s packet with id %" PRIu16 " on interface %i/%s.", DNS_PACKET_QR(p) ? "response" : "query", DNS_PACKET_ID(p), ifindex, af_to_name(family));
if (family == AF_INET)
return manager_ipv4_send(m, fd, ifindex, &destination->in, port, &source->in, p);
return manager_ipv4_send(m, fd, ifindex, &destination->in, port, source ? &source->in : NULL, p);
if (family == AF_INET6)
return manager_ipv6_send(m, fd, ifindex, &destination->in6, port, &source->in6, p);
return manager_ipv6_send(m, fd, ifindex, &destination->in6, port, source ? &source->in6 : NULL, p);
return -EAFNOSUPPORT;
}