1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00

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

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)); 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) 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) 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; return -EAFNOSUPPORT;
} }