From: Dan Carpenter <dan.carpenter@linaro.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: William Hubbs <w.d.hubbs@gmail.com>,
Chris Brannon <chris@the-brannons.com>,
Kirk Reiser <kirk@reisers.ca>,
Samuel Thibault <samuel.thibault@ens-lyon.org>,
Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
speakup@linux-speakup.org
Subject: Re: [PATCH] accessibility: speakup: Fix incorrect string length computation in report_char_chartab_status()
Date: Wed, 6 Sep 2023 12:09:25 +0300 [thread overview]
Message-ID: <10d321d6-89ab-464e-971d-bb9635a5308f@moroto.mountain> (raw)
In-Reply-To: <b388b088485aff5dc223f2723ee61e00e5cd3f7d.1693855874.git.christophe.jaillet@wanadoo.fr>
On Mon, Sep 04, 2023 at 09:31:44PM +0200, Christophe JAILLET wrote:
> snprintf() returns the "number of characters which *would* be generated for
> the given input", not the size *really* generated.
>
> In order to avoid too large values for 'len' (and potential negative
> values for "sizeof(buf) - (len - 1)") use scnprintf() instead of
> snprintf().
>
A bunch of kernel-janitors mail didn't reach my inbox... Like this
one. So weird.
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
The impact of this bug is a WARN() btw. snprintf() will refuse to
print negative bytes.
regards,
dan carpenter
prev parent reply other threads:[~2023-09-06 9:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 19:31 Christophe JAILLET
2023-09-04 19:36 ` Samuel Thibault
2023-09-06 9:09 ` Dan Carpenter [this message]
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=10d321d6-89ab-464e-971d-bb9635a5308f@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=chris@the-brannons.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@suse.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=kirk@reisers.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=speakup@linux-speakup.org \
--cc=w.d.hubbs@gmail.com \
/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
all inboxes | Powered by JetHome®