From: Yu Watanabe Date: Fri, 2 Dec 2022 05:14:50 +0000 (+0900) Subject: fuzz-systemctl: limit the size of input X-Git-Tag: v253-rc1~390 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=719b7d4dc2bde3a9257e9f6fdcf03239ee2324b6;p=thirdparty%2Fsystemd.git fuzz-systemctl: limit the size of input Fixes [oss-fuzz#53552](https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53552). Fixes #25445. --- diff --git a/src/systemctl/fuzz-systemctl-parse-argv.c b/src/systemctl/fuzz-systemctl-parse-argv.c index 92f6ecaa8d0..52574ba9968 100644 --- a/src/systemctl/fuzz-systemctl-parse-argv.c +++ b/src/systemctl/fuzz-systemctl-parse-argv.c @@ -19,6 +19,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { _cleanup_close_ int orig_stdout_fd = -1; int r; + if (size > 4*1024*1024) + return 0; /* See the comment below about the limit for strv_length(). */ + /* We don't want to fill the logs with messages about parse errors. * Disable most logging if not running standalone */ if (!getenv("SYSTEMD_LOG_LEVEL"))