From: Jules Maselbas <jmaselbas@zdiv.net>
To: barebox@lists.infradead.org
Cc: Jules Maselbas <jmaselbas@zdiv.net>
Subject: [PATCH 1/2] vsprintf: fix missing break when printing %pJP
Date: Tue, 25 Mar 2025 16:53:26 +0100 [thread overview]
Message-ID: <20250325155327.31981-1-jmaselbas@zdiv.net> (raw)
When the format `%pJP` was introduced the new switch case didn't had a
break at the end, it was last case in the switch. However subsequent
commit didn't add a break either, creating a potential fallthrough.
Add the missing break.
Fixes: 107eeef8f2 ("vsprintf: add support for printing MAC addresses")
Signed-off-by: Jules Maselbas <jmaselbas@zdiv.net>
---
lib/vsprintf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index f553662ce8..0656ba3620 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -561,6 +561,7 @@ static char *pointer(const char *fmt, char *buf, const char *end, const void *pt
case 'J':
if (fmt[1] == 'P' && IS_ENABLED(CONFIG_JSMN))
return jsonpath_string(buf, end, ptr, field_width, precision, flags, fmt);
+ break;
case 'M':
/* Colon separated: 00:01:02:03:04:05 */
return mac_address_string(buf, end, ptr, field_width, precision, flags, fmt);
--
2.48.1
next reply other threads:[~2025-03-25 16:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 15:53 Jules Maselbas [this message]
2025-03-25 15:53 ` [PATCH 2/2] vsprintf: add explicit fallthrough Jules Maselbas
2025-03-25 16:58 ` [PATCH 1/2] vsprintf: fix missing break when printing %pJP Ahmad Fatoum
2025-03-27 7:38 ` Sascha Hauer
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=20250325155327.31981-1-jmaselbas@zdiv.net \
--to=jmaselbas@zdiv.net \
--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