https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a8027265772f608bcdf09…
commit a8027265772f608bcdf0918c5f4434852806ec1d
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Wed May 8 20:06:49 2019 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Wed May 8 20:08:13 2019 +0200
[BASESRV] Fix the BNO string buffer usage
This avoids reinitializing it before use.
---
subsystems/win/basesrv/init.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c
index 87514d96b4..ebfe937068 100644
--- a/subsystems/win/basesrv/init.c
+++ b/subsystems/win/basesrv/init.c
@@ -290,7 +290,8 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
{
NTSTATUS Status;
BOOLEAN Success;
- WCHAR Buffer[MAX_PATH];
+ WCHAR BnoBuffer[100];
+ WCHAR Buffer[100];
PWCHAR HeapBuffer;
UNICODE_STRING SystemRootString;
UNICODE_STRING UnexpandedSystemRootString =
RTL_CONSTANT_STRING(L"%SystemRoot%");
@@ -353,8 +354,8 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
ASSERT(Success);
/* FIXME: Check Session ID */
- wcscpy(Buffer, L"\\BaseNamedObjects");
- RtlInitUnicodeString(&BnoString, Buffer);
+ wcscpy(BnoBuffer, L"\\BaseNamedObjects");
+ RtlInitUnicodeString(&BnoString, BnoBuffer);
/* Allocate the server data */
BaseStaticServerData = RtlAllocateHeap(BaseSrvSharedHeap,
@@ -474,7 +475,6 @@ BaseInitializeStaticServerData(IN PCSR_SERVER_DLL LoadedServerDll)
ASSERT(NT_SUCCESS(Status));
/* Create the BNO directory */
- RtlInitUnicodeString(&BnoString, L"\\BaseNamedObjects");
InitializeObjectAttributes(&ObjectAttributes,
&BnoString,
OBJ_OPENIF | OBJ_PERMANENT | OBJ_CASE_INSENSITIVE,