From 58c3bc12a54c9d78fe0999036a3cca70bdda1d6e Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Sat, 30 Oct 2021 18:09:30 +0000 Subject: [PATCH] mount_fuzz: reject giant files early It should help to address https://github.com/google/oss-fuzz/issues/6703 Signed-off-by: Evgeny Vereshchagin --- libmount/src/fuzz.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmount/src/fuzz.c b/libmount/src/fuzz.c index e845016a0a..2c84714430 100644 --- a/libmount/src/fuzz.c +++ b/libmount/src/fuzz.c @@ -13,6 +13,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (size == 0) return 0; + // 128Kb should be enough to trigger all the issues we're interested in + if (size > 131072) + return 0; + tb = mnt_new_table(); if (!tb) err_oom(); -- 2.47.3