From: Jiri Slaby <jirislaby@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
krisman@collabora.com
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] unicode: don't write -1 after NULL terminator
Date: Thu, 3 Nov 2022 08:00:44 +0100 [thread overview]
Message-ID: <79db9616-a2ee-9a1a-9a35-b82f65b6d15e@kernel.org> (raw)
In-Reply-To: <20221103012411.86537-1-Jason@zx2c4.com>
On 03. 11. 22, 2:24, Jason A. Donenfeld wrote:
> If the intention is to overwrite the first NULL with a -1, s[strlen(s)]
> is the first NULL, not s[strlen(s)+1].
This caught my attention. You mix NULL (void *) with NUL (\0) in the
changelog & subject. That occurs rather confusing to me.
> Cc: Gabriel Krisman Bertazi <krisman@collabora.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> fs/unicode/mkutf8data.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/unicode/mkutf8data.c b/fs/unicode/mkutf8data.c
> index bc1a7c8b5c8d..61800e0d3226 100644
> --- a/fs/unicode/mkutf8data.c
> +++ b/fs/unicode/mkutf8data.c
> @@ -3194,7 +3194,7 @@ static int normalize_line(struct tree *tree)
> /* Second test: length-limited string. */
> s = buf2;
> /* Replace NUL with a value that will cause an error if seen. */
> - s[strlen(s) + 1] = -1;
> + s[strlen(s)] = -1;
> t = buf3;
> if (utf8cursor(&u8c, tree, s))
> return -1;
--
js
suse labs
next prev parent reply other threads:[~2022-11-03 7:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-03 1:24 [PATCH] unicode: don't write -1 after NULL terminator Jason A. Donenfeld
2022-11-03 7:00 ` Jiri Slaby [this message]
2022-11-03 11:30 ` [PATCH v2] unicode: don't write -1 after NUL terminator Jason A. Donenfeld
2022-11-07 14:45 ` Gabriel Krisman Bertazi
2022-11-07 15:09 ` Jason A. Donenfeld
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=79db9616-a2ee-9a1a-9a35-b82f65b6d15e@kernel.org \
--to=jirislaby@kernel.org \
--cc=Jason@zx2c4.com \
--cc=krisman@collabora.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).