dhcp6: use unaligned_read_be32() v243.2
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Sep 2019 13:14:45 +0000 (22:14 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 21 Sep 2019 21:07:00 +0000 (23:07 +0200)
Closes #13591.

(cherry picked from commit 0eb5e6d3f08c6b3a41cfa7ac02bcc6302259ed4a)

src/libsystemd-network/sd-dhcp6-client.c
test/fuzz/fuzz-dhcp6-client/crash-13591 [new file with mode: 0644]

index 5a3b0a6353bd851694ea7804f32dd4543528933f..9773a067d5858464ce67884861102b35c9f6b94c 100644 (file)
@@ -1005,7 +1005,7 @@ static int client_parse_message(
                         if (optlen != 4)
                                 return -EINVAL;
 
-                        irt = be32toh(*(be32_t *) optval) * USEC_PER_SEC;
+                        irt = unaligned_read_be32((be32_t *) optval) * USEC_PER_SEC;
                         break;
                 }
 
diff --git a/test/fuzz/fuzz-dhcp6-client/crash-13591 b/test/fuzz/fuzz-dhcp6-client/crash-13591
new file mode 100644 (file)
index 0000000..20ac358
Binary files /dev/null and b/test/fuzz/fuzz-dhcp6-client/crash-13591 differ