https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a976ebb0315a0b27438ed…
commit a976ebb0315a0b27438edb04fd69555e7de732df
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sun Mar 24 10:55:04 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Mon Mar 25 08:43:47 2019 +0100
[NTOS:IO] Avoid an unnecessary stack buffer in OpenRegistryHandlesFromSymbolicLink.
CORE-15882
---
ntoskrnl/io/iomgr/deviface.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/ntoskrnl/io/iomgr/deviface.c b/ntoskrnl/io/iomgr/deviface.c
index 0e1f32f5ca4..34245027627 100644
--- a/ntoskrnl/io/iomgr/deviface.c
+++ b/ntoskrnl/io/iomgr/deviface.c
@@ -37,7 +37,6 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING
SymbolicLinkName,
IN OPTIONAL PHANDLE InstanceKey)
{
OBJECT_ATTRIBUTES ObjectAttributes;
- WCHAR PathBuffer[MAX_PATH];
UNICODE_STRING BaseKeyU;
UNICODE_STRING GuidString, SubKeyName, ReferenceString;
PWCHAR StartPosition, EndPosition;
@@ -67,11 +66,7 @@ OpenRegistryHandlesFromSymbolicLink(IN PUNICODE_STRING
SymbolicLinkName,
*DeviceKeyRealP = NULL;
*InstanceKeyRealP = NULL;
- BaseKeyU.Buffer = PathBuffer;
- BaseKeyU.Length = 0;
- BaseKeyU.MaximumLength = MAX_PATH * sizeof(WCHAR);
-
- RtlAppendUnicodeToString(&BaseKeyU, BaseKeyString);
+ RtlInitUnicodeString(&BaseKeyU, BaseKeyString);
/* Open the DeviceClasses key */
InitializeObjectAttributes(&ObjectAttributes,