From: Damien Le Moal <dlemoal@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCH] ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()
Date: Mon, 11 Sep 2023 15:14:00 +0900 [thread overview]
Message-ID: <9ec1c919-504a-a50a-4f75-5a1ab63b1ab5@kernel.org> (raw)
In-Reply-To: <1a35e114a3dcc33053ca7cca41cb06b8426d8c40.1693857262.git.christophe.jaillet@wanadoo.fr>
On 9/5/23 04:54, 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 'o' (and potential negative values
> for "sizeof(linebuf) o") use scnprintf() instead of snprintf().
>
> Note that given the "w < 4" in the for loop, the buffer can NOT
> overflow, but using the *right* function is always better.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied to for-6.6-fixes. Thanks !
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2023-09-11 6:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 19:54 Christophe JAILLET
2023-09-05 5:04 ` Damien Le Moal
2023-09-05 15:28 ` Christophe JAILLET
2023-09-06 1:11 ` Damien Le Moal
2023-09-08 5:18 ` Christophe JAILLET
2023-09-11 6:14 ` Damien Le Moal [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=9ec1c919-504a-a50a-4f75-5a1ab63b1ab5@kernel.org \
--to=dlemoal@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®