* [PATCH] vsprintf: drop printf hexstr fuzzer
@ 2025-09-01 11:50 Ahmad Fatoum
0 siblings, 0 replies; only message in thread
From: Ahmad Fatoum @ 2025-09-01 11:50 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
This fuzzer was an early proof of concept as can be seen by the
useless initialized variable and its name is misleading:
It only tests the hexstr feature.
Unlike other tests, it also spams stdout. Let's just drop it for now and
perhaps bring it back in future in a more complete form.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
images/Makefile.sandbox | 1 -
lib/vsprintf.c | 15 ---------------
2 files changed, 16 deletions(-)
diff --git a/images/Makefile.sandbox b/images/Makefile.sandbox
index d13ffb0124b1..5f94b6e589e8 100644
--- a/images/Makefile.sandbox
+++ b/images/Makefile.sandbox
@@ -9,7 +9,6 @@ fuzzer-$(CONFIG_FITIMAGE) += fit
fuzzer-$(CONFIG_OFTREE) += dtb
fuzzer-$(CONFIG_OFTREE) += fdt-compatible
fuzzer-$(CONFIG_PARTITION) += partitions
-fuzzer-$(CONFIG_PRINTF_HEXSTR) += printf
ifeq ($(CONFIG_SANDBOX),y)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 66b2f4641874..409a8f02dec9 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -22,7 +22,6 @@
#include <wchar.h>
#include <of.h>
#include <efi.h>
-#include <fuzz.h>
#include <common.h>
#include <pbl.h>
@@ -1006,17 +1005,3 @@ int asprintf(char **strp, const char *fmt, ...)
return len;
}
EXPORT_SYMBOL(asprintf);
-
-static int __maybe_unused fuzz_printf(const uint8_t *data, size_t size)
-{
- static bool initialized = false;
-
- if (!initialized) {
- printf("initializing\n");
- initialized = true;
- }
-
- printf("%*ph\n", (int)size, data);
- return 0;
-}
-fuzz_test("printf", fuzz_printf);
--
2.47.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-01 14:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-01 11:50 [PATCH] vsprintf: drop printf hexstr fuzzer Ahmad Fatoum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox