]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network: tc: fix n_prio bounds check
authorVito Caputo <vcaputo@pengaru.com>
Mon, 6 Jul 2020 07:36:51 +0000 (00:36 -0700)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 6 Jul 2020 13:52:17 +0000 (15:52 +0200)
Looks like a simple copy and paste error

Fixes https://github.com/systemd/systemd/issues/16367

src/network/tc/ets.c
test/fuzz/fuzz-network-parser/oss-fuzz-23895 [new file with mode: 0644]

index c4fa5646dd53187e2393b0435e8c52daa52cbf5b..83e9d8bff38a84f463370f29bd6c12fadd3c6016 100644 (file)
@@ -283,7 +283,7 @@ int config_parse_ets_prio(
                                    lvalue, word);
                         continue;
                 }
-                if (ets->n_quanta > TC_PRIO_MAX) {
+                if (ets->n_prio > TC_PRIO_MAX) {
                         log_syntax(unit, LOG_ERR, filename, line, 0,
                                    "Too many priomap in '%s=', ignoring assignment: %s",
                                    lvalue, word);
diff --git a/test/fuzz/fuzz-network-parser/oss-fuzz-23895 b/test/fuzz/fuzz-network-parser/oss-fuzz-23895
new file mode 100644 (file)
index 0000000..a86361d
Binary files /dev/null and b/test/fuzz/fuzz-network-parser/oss-fuzz-23895 differ