]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-ndisc,sd-radv: fix use of uninitialized value
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Sep 2023 07:51:25 +0000 (16:51 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Sep 2023 10:31:40 +0000 (19:31 +0900)
When icmp6_receive() fails, then the source address is not initialized yet.

src/libsystemd-network/sd-ndisc.c
src/libsystemd-network/sd-radv.c

index ca5365b95ffec647633a357610b7a52a008fae65..8a6760188d1dca78dbe69af37cccb87cbe6e6e42 100644 (file)
@@ -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:
index cb7bc07f5af759e293b4bb3bca2bbc79de7a914c..afb0fd95b66eb5c6a09a5e657b8c7cd5d5188579 100644 (file)
@@ -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: