Re: [PATCH 16/30] scsi: arcmsr: arcmsr_hba: Make room for the trailing NULL, even if it is over-written

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

 



On Wed, 15 Jul 2020, Martin K. Petersen wrote:

> 
> Lee,
> 
> > Ensure we do not copy the final one (which is not overwitten).
> >
> > -		strncpy(&inqdata[8], "Areca   ", 8);
> > +		strncpy(&inqdata[8], "Areca   ", 9);
> >  		/* Vendor Identification */
> > -		strncpy(&inqdata[16], "RAID controller ", 16);
> > +		strncpy(&inqdata[16], "RAID controller ", 17);
> >  		/* Product Identification */
> > -		strncpy(&inqdata[32], "R001", 4); /* Product Revision */
> > +		strncpy(&inqdata[32], "R001", 5); /* Product Revision */
> 
> SCSI INQUIRY strings are fixed length and not NULL-terminated. Please
> address this warning using either memcpy() or strlcpy().

Will do.  Thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog



[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