Re: [PATCH 6/6] scsi: qedf: use correct strncpy() size

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

 



On Fri, 2 Feb 2018, 8:12am, Arnd Bergmann wrote:

> gcc-8 warns during link-time optimization that the strncpy() call
> passes the size of the source buffer rather than the destination:
> 
> drivers/scsi/qedf/qedf_dbg.c: In function 'qedf_uevent_emit':
> include/linux/string.h:253: error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
> 
> This changes it to strscpy() with the correct length, guaranteeing
> a properly nul-terminated string of the right size.
> 
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
> ---
>  drivers/scsi/qedf/qedf_dbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reasonable security precaution.

Acked-by: Chad Dupuis <chad.dupuis@xxxxxxxxxx>



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux