projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b8e091a
)
[NTOS:PNP] Reduce the default buffer size in EnumerateDevices. CORE-15882
1719/head
author
Thomas Faber
<thomas.faber@reactos.org>
Sat, 20 Apr 2019 08:49:13 +0000
(10:49 +0200)
committer
Thomas Faber
<thomas.faber@reactos.org>
Wed, 10 Jul 2019 08:58:47 +0000
(10:58 +0200)
ntoskrnl/io/pnpmgr/pnproot.c
patch
|
blob
|
history
diff --git
a/ntoskrnl/io/pnpmgr/pnproot.c
b/ntoskrnl/io/pnpmgr/pnproot.c
index
65ea5cc
..
03ae981
100644
(file)
--- a/
ntoskrnl/io/pnpmgr/pnproot.c
+++ b/
ntoskrnl/io/pnpmgr/pnproot.c
@@
-461,7
+461,8
@@
EnumerateDevices(
DeviceExtension = (PPNPROOT_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
KeAcquireGuardedMutex(&DeviceExtension->DeviceListLock);
- KeyInfoSize = sizeof(KEY_BASIC_INFORMATION) + (MAX_PATH + 1) * sizeof(WCHAR);
+ /* Should hold most key names, but we reallocate below if it's too small */
+ KeyInfoSize = FIELD_OFFSET(KEY_BASIC_INFORMATION, Name) + 64 * sizeof(WCHAR);
KeyInfo = ExAllocatePoolWithTag(PagedPool,
KeyInfoSize + sizeof(UNICODE_NULL),
TAG_PNP_ROOT);