Re: [PATCH v2 2/2] zram: zram_drv: replace 'strlcpy()'

From: Christoph Hellwig
Date: Tue Dec 21 2021 - 03:59:15 EST


On Fri, Dec 17, 2021 at 07:32:24AM +0100, Miko Larsson wrote:
> 'strlcpy()' shouldn't be used, and should be replaced with safer
> alternatives. Cristoph Hellwig suggested [1] that 'kmemdup_nul()' should
> be used in two cases instead of 'strscpy()', and that a regular
> 'strcpy()' should be used in the third case. [2][3]

Not that strcpy isn't really safer, but if your plan is to get rid
of strlcpy I think it makes more sense there.

Reviewed-by: Christoph Hellwig <hch@xxxxxx>