lkml.org 
[lkml]   [2020]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 16/30] scsi: arcmsr: arcmsr_hba: Make room for the trailing NULL, even if it is over-written
From
Date

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().

Thanks!

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2020-07-15 22:26    [W:0.133 / U:1.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site