Re: [PATCH] ata: sata_mv: Fix incorrect string length computation in mv_dump_mem()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/5/23 04:54, Christophe JAILLET wrote:
> snprintf() returns the "number of characters which *would* be generated for
> the given input", not the size *really* generated.
> 
> In order to avoid too large values for 'o' (and potential negative values
> for "sizeof(linebuf) o") use scnprintf() instead of snprintf().
> 
> Note that given the "w < 4" in the for loop, the buffer can NOT
> overflow, but using the *right* function is always better.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>

Applied to for-6.6-fixes. Thanks !


-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux