From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Jules Maselbas <jmaselbas@zdiv.net>, barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] vsprintf: fix missing break when printing %pJP
Date: Tue, 25 Mar 2025 17:58:02 +0100 [thread overview]
Message-ID: <13bee917-8783-456f-9426-71e77747f050@pengutronix.de> (raw)
In-Reply-To: <20250325155327.31981-1-jmaselbas@zdiv.net>
Hello Jules,
On 3/25/25 16:53, Jules Maselbas wrote:
> 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>
Ouch, Good catch.
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Thanks,
Ahmad
> ---
> 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);
next prev parent reply other threads:[~2025-03-25 16:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 15:53 Jules Maselbas
2025-03-25 15:53 ` [PATCH 2/2] vsprintf: add explicit fallthrough Jules Maselbas
2025-03-25 16:58 ` Ahmad Fatoum [this message]
2025-03-27 7:38 ` [PATCH 1/2] vsprintf: fix missing break when printing %pJP 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=13bee917-8783-456f-9426-71e77747f050@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jmaselbas@zdiv.net \
/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