From 25270cf3dba887360e607b23d3264d110961659b Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 11 Oct 2018 18:36:18 +0900 Subject: [PATCH] resolve: fix member access within null pointer Fixes #10333. --- src/resolve/resolved-manager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index 00252afdf3..f99a7b3d8d 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -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; }