]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mount_fuzz: reject giant files early
authorEvgeny Vereshchagin <evvers@ya.ru>
Sat, 30 Oct 2021 18:09:30 +0000 (18:09 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Sat, 30 Oct 2021 18:25:02 +0000 (18:25 +0000)
It should help to address https://github.com/google/oss-fuzz/issues/6703

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
libmount/src/fuzz.c

index e845016a0a03398fe397b2dab605618f50d4f5cc..2c847144302eb43c65748473fbcefb835bcbbd26 100644 (file)
@@ -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();