[HAL/x86]

Fix buffer overruns

svn path=/trunk/; revision=53788
This commit is contained in:
Pierre Schweitzer 2011-09-21 16:10:32 +00:00
parent 104f40f71f
commit 87d6daee6c
2 changed files with 2 additions and 2 deletions

View file

@ -323,7 +323,7 @@ HalpReportResourceUsage(IN PUNICODE_STRING HalName,
while (TRUE)
{
/* Check for valid vector number */
if (i <= MAXIMUM_IDTVECTOR)
if (i < MAXIMUM_IDTVECTOR)
{
/* Check if this entry should be parsed */
if ((HalpIDTUsageFlags[i].Flags & FlagMatch))

View file

@ -721,7 +721,7 @@ HalpDebugPciDumpBus(IN ULONG i,
SubClassName += 5;
p = strchr(SubClassName, '\r');
Length = p - SubClassName;
if (Length > sizeof(bSubClassName)) Length = sizeof(bSubClassName);
if (Length > sizeof(bSubClassName)) Length = sizeof(bSubClassName) - 1;
strncpy(bSubClassName, SubClassName, Length);
bSubClassName[Length] = '\0';
}