From 4674f407b2a96baaed4c8226342bccb313463717 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 4 Sep 2023 16:51:25 +0900 Subject: [PATCH] sd-ndisc,sd-radv: fix use of uninitialized value When icmp6_receive() fails, then the source address is not initialized yet. --- src/libsystemd-network/sd-ndisc.c | 3 +-- src/libsystemd-network/sd-radv.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/libsystemd-network/sd-ndisc.c b/src/libsystemd-network/sd-ndisc.c index ca5365b95f..8a6760188d 100644 --- a/src/libsystemd-network/sd-ndisc.c +++ b/src/libsystemd-network/sd-ndisc.c @@ -225,8 +225,7 @@ static int ndisc_recv(sd_event_source *s, int fd, uint32_t revents, void *userda if (r < 0) switch (r) { case -EADDRNOTAVAIL: - log_ndisc(nd, "Received RA from non-link-local address %s. Ignoring.", - IN6_ADDR_TO_STRING(&rt->address)); + log_ndisc(nd, "Received RA from non-link-local address. Ignoring."); return 0; case -EMULTIHOP: diff --git a/src/libsystemd-network/sd-radv.c b/src/libsystemd-network/sd-radv.c index cb7bc07f5a..afb0fd95b6 100644 --- a/src/libsystemd-network/sd-radv.c +++ b/src/libsystemd-network/sd-radv.c @@ -264,8 +264,7 @@ static int radv_recv(sd_event_source *s, int fd, uint32_t revents, void *userdat if (r < 0) switch (r) { case -EADDRNOTAVAIL: - log_radv(ra, "Received RS from non-link-local address %s. Ignoring", - IN6_ADDR_TO_STRING(&src)); + log_radv(ra, "Received RS from non-link-local address. Ignoring"); return 0; case -EMULTIHOP: