mirror of
https://github.com/reactos/reactos.git
synced 2024-07-11 07:05:12 +00:00
[HAL]
Do not write past the end of buffer. svn path=/trunk/; revision=54028
This commit is contained in:
parent
59730dc09c
commit
9fc97e9f95
|
@ -736,9 +736,9 @@ HalpDebugPciDumpBus(IN ULONG i,
|
|||
VendorName += 7;
|
||||
p = strchr(VendorName, '\r');
|
||||
Length = p - VendorName;
|
||||
if (Length > sizeof(bVendorName)) Length = sizeof(bVendorName);
|
||||
if (Length >= sizeof(bVendorName)) Length = sizeof(bVendorName) - 1;
|
||||
strncpy(bVendorName, VendorName, Length);
|
||||
bVendorName[Length ] = '\0';
|
||||
bVendorName[Length] = '\0';
|
||||
|
||||
/* Isolate the product name */
|
||||
sprintf(LookupString, "\t%04x", PciData->DeviceID);
|
||||
|
@ -749,7 +749,7 @@ HalpDebugPciDumpBus(IN ULONG i,
|
|||
ProductName += 7;
|
||||
p = strchr(ProductName, '\r');
|
||||
Length = p - ProductName;
|
||||
if (Length > sizeof(bProductName)) Length = sizeof(bProductName);
|
||||
if (Length >= sizeof(bProductName)) Length = sizeof(bProductName) - 1;
|
||||
strncpy(bProductName, ProductName, Length);
|
||||
bProductName[Length] = '\0';
|
||||
|
||||
|
@ -765,7 +765,7 @@ HalpDebugPciDumpBus(IN ULONG i,
|
|||
SubVendorName += 13;
|
||||
p = strchr(SubVendorName, '\r');
|
||||
Length = p - SubVendorName;
|
||||
if (Length > sizeof(bSubVendorName)) Length = sizeof(bSubVendorName);
|
||||
if (Length >= sizeof(bSubVendorName)) Length = sizeof(bSubVendorName) - 1;
|
||||
strncpy(bSubVendorName, SubVendorName, Length);
|
||||
bSubVendorName[Length] = '\0';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue