From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] libhandle: fix potential unterminated string problem
Date: Thu, 15 Oct 2020 09:29:04 +0100 [thread overview]
Message-ID: <20201015082904.GC4450@infradead.org> (raw)
In-Reply-To: <20201008035834.GB6535@magnolia>
On Wed, Oct 07, 2020 at 08:58:34PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> gcc 10.2 complains about the strncpy call here, since it's possible that
> the source string is so long that the fspath inside the fdhash structure
> will end up without a null terminator. Work around strncpy braindamage
> yet again by forcing the string to be terminated properly.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> Unless this is supposed to be a memcpy? But it doesn't look like it.
No, it should not be memcy, and the change looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
That being said path_to_fspath where fspath originates is horrible
and not mutlithreading safe due to the static filename buffer.
prev parent reply other threads:[~2020-10-15 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 3:58 [PATCH] libhandle: fix potential unterminated string problem Darrick J. Wong
2020-10-08 21:53 ` Eric Sandeen
2020-10-15 8:29 ` Christoph Hellwig [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=20201015082904.GC4450@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.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