[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIo0EVzhbbLd89sV@black.igk.intel.com>
Date: Wed, 30 Jul 2025 17:02:41 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Theodore Ts'o <tytso@....edu>
Cc: Ext4 Developers List <linux-ext4@...r.kernel.org>,
linux-hardening@...r.kernel.org, ethan@...ancedwards.com
Subject: Re: [PATCH 2/3] ext4: use memcpy() instead of strcpy()
On Sat, Jul 12, 2025 at 02:12:48PM -0400, Theodore Ts'o wrote:
> The strcpy() function is considered dangerous and eeeevil by people
> who are using sophisticated code analysis tools such as "grep". This
> is true even when a quick inspection would show that the source is a
> constant string ("." or "..") and the destination is a fixed array
> which is guaranteed to have enough space. Make the "grep" code
> analysis tool happy by using memcpy() isstead of strcpy(). :-)
Why simple 2-arg strscpy() can't be used?
...
> - strcpy(fake.name, ".");
> + memcpy(fake.name, ".", 2);
s/strcpy/strscpy/
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists