From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] vsprintf: drop printf hexstr fuzzer
Date: Mon, 1 Sep 2025 13:50:53 +0200 [thread overview]
Message-ID: <20250901115054.2514841-1-a.fatoum@pengutronix.de> (raw)
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
reply other threads:[~2025-09-01 14:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250901115054.2514841-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox