]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: fix member access within null pointer 10358/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Oct 2018 09:36:18 +0000 (18:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 11 Oct 2018 09:36:21 +0000 (18:36 +0900)
Fixes #10333.

src/resolve/resolved-manager.c

index 00252afdf3087642ed4e95c72ba6e93ea3d1921d..f99a7b3d8d7f4f4098861896e4fa0f21c73d7f44 100644 (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;
 }