diff --git a/fuzz/lint.c b/fuzz/lint.c index 483e278fd..65e33eeaa 100644 --- a/fuzz/lint.c +++ b/fuzz/lint.c @@ -30,8 +30,6 @@ * * --path: Requires cooperation with resource loader * - * --repeat: Could be limited to 2 when fuzzing - * * --relaxng: * --schema: * --schematron: Requires schemas @@ -79,6 +77,7 @@ static const char *const switches[] = { "--pushsmall", "--quiet", "--recover", + "--repeat", "--sax1", "--testIO", "--timing", diff --git a/xmllint.c b/xmllint.c index 272d8a589..84ca7eba6 100644 --- a/xmllint.c +++ b/xmllint.c @@ -3023,10 +3023,14 @@ xmllintParseOptions(xmllintState *lint, int argc, const char **argv) { lint->generate = 1; } else if ((!strcmp(argv[i], "-repeat")) || (!strcmp(argv[i], "--repeat"))) { +#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + lint->repeat = 2; +#else if (lint->repeat > 1) lint->repeat *= 10; else lint->repeat = 100; +#endif #ifdef LIBXML_PUSH_ENABLED } else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push"))) {