]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: fix ABRT 14805/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Feb 2020 04:35:29 +0000 (13:35 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 7 Feb 2020 08:18:58 +0000 (17:18 +0900)
Fixes #14811 and oss-fuzz#20548.

src/network/networkd-ndisc.c
test/fuzz/fuzz-network-parser/oss-fuzz-20548 [new file with mode: 0644]

index 0b160bdfe64a6a3c2a2aa5bd6d7a4de13cf3d16e..4bdc26a38fc78ba91d88bc52edeecaeef14c05e3 100644 (file)
@@ -999,7 +999,13 @@ int config_parse_address_generation_type(
         else {
                 token->address_generation_type = IPV6_TOKEN_ADDRESS_GENERATION_STATIC;
                 p = rvalue;
-       }
+        }
+
+        if (isempty(p)) {
+                log_syntax(unit, LOG_ERR, filename, line, 0,
+                           "Invalid IPv6Token= , ignoring assignment: %s", rvalue);
+                return 0;
+        }
 
         r = in_addr_from_string(AF_INET6, p, &buffer);
         if (r < 0) {
diff --git a/test/fuzz/fuzz-network-parser/oss-fuzz-20548 b/test/fuzz/fuzz-network-parser/oss-fuzz-20548
new file mode 100644 (file)
index 0000000..82efed5
Binary files /dev/null and b/test/fuzz/fuzz-network-parser/oss-fuzz-20548 differ