mirror of
https://github.com/reactos/reactos.git
synced 2025-01-13 01:22:03 +00:00
Don't write outside the array in SetupDiGetClassDevPropertySheetsW
svn path=/trunk/; revision=19794
This commit is contained in:
parent
5073c262ee
commit
de42f618e0
1 changed files with 2 additions and 2 deletions
|
@ -3733,14 +3733,14 @@ BOOL WINAPI SetupDiGetClassDevPropertySheetsW(
|
|||
Request.DeviceInfoSet = DeviceInfoSet;
|
||||
Request.DeviceInfoData = DeviceInfoData;
|
||||
PropPageData.PropertySheetPages = &PropertySheetHeader->phpage[PropertySheetHeader->nPages];
|
||||
PropPageData.MaximumNumberOfPages = PropertySheetHeaderPageListSize;
|
||||
PropPageData.MaximumNumberOfPages = PropertySheetHeaderPageListSize - PropertySheetHeader->nPages;
|
||||
PropPageData.NumberOfPages = 0;
|
||||
ret = pPropPageProvider(&Request, GetClassDevPropertySheetsCallback, (LPARAM)&PropPageData);
|
||||
if (!ret)
|
||||
goto cleanup;
|
||||
|
||||
if (RequiredSize)
|
||||
*RequiredSize = PropPageData.NumberOfPages;
|
||||
*RequiredSize = PropPageData.NumberOfPages + PropertySheetHeader->nPages;
|
||||
if (PropPageData.NumberOfPages <= PropPageData.MaximumNumberOfPages)
|
||||
{
|
||||
PropertySheetHeader->nPages += PropPageData.NumberOfPages;
|
||||
|
|
Loading…
Reference in a new issue