Commit 899d0ca025 for openssl.org
commit 899d0ca02559e105b9cb30964e3478dfbd8c4578
Author: ThatRetiredDude <ThatRetiredDude@tatryfab.com>
Date: Thu Nov 5 10:50:43 2026 +0000
fuzz/provider.c: Always return 0 from FuzzerTestOneInput()
libFuzzer treats any non-zero return value from a fuzz target as a
signal to discard the input, and other engines used by OSS-Fuzz do not
necessarily support that at all. The provider fuzzer returned 1 for
every input of 16 bytes or more, so none of those inputs were ever kept
in the corpus.
Drop the r variable and always return 0.
Fixes #32897
CLA: trivial
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Reviewed-by: Igor Ustinov <igus@openssl.foundation>
Merge-date: Mon Nov 16 14:23:36 2026
Merged-from: https://github.com/openssl/openssl/pull/33406
diff --git a/fuzz/provider.c b/fuzz/provider.c
index bc45489a2f..f038bbd46a 100644
--- a/fuzz/provider.c
+++ b/fuzz/provider.c
@@ -697,19 +697,14 @@ end:
int FuzzerTestOneInput(const uint8_t *buf, size_t len)
{
- int r = 1;
uint64_t *operation = NULL;
int64_t *algorithm = NULL;
- if (!read_uint(&buf, &len, &operation)) {
- r = 0;
+ if (!read_uint(&buf, &len, &operation))
goto end;
- }
- if (!read_int(&buf, &len, &algorithm)) {
- r = 0;
+ if (!read_int(&buf, &len, &algorithm))
goto end;
- }
switch (*operation % 10) {
case 0:
@@ -750,12 +745,11 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
/* not yet implemented */
break;
default:
- r = 0;
goto end;
}
end:
OPENSSL_free(operation);
OPENSSL_free(algorithm);
- return r;
+ return 0;
}