[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ybt8wY3U2ETjQijH@infradead.org>
Date: Thu, 16 Dec 2021 09:52:01 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Miko Larsson <mikoxyzzz@...il.com>
Cc: Christoph Hellwig <hch@...radead.org>, minchan@...nel.org,
ngupta@...are.org, senozhatsky@...omium.org, axboe@...nel.dk,
linux-kernel@...r.kernel.org, linux-block@...r.kernel.org
Subject: Re: [PATCH 2/2] zram: zram_drv: replace strlcpy with strscpy
On Thu, Dec 16, 2021 at 04:00:21PM +0100, Miko Larsson wrote:
> Thanks for the heads-up! That only seems to apply to the assignment of
> 'file_name'. The usage of strscpy seems to be correct in the other two
> cases, though (since they're char arrays.) I suspect I might be wrong
> though, since my knowledge of C is shabby at best.
The second one also sounds like a case for memdup_nul. That adds a
memory allocation, but it keeps all the checking nicely encapsulated,
and the last one should be fine with a plain old mempcy.
Powered by blists - more mailing lists