https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa912422e5c5ca4e7c396429d719101f8a08ea09

commit aa912422e5c5ca4e7c396429d719101f8a08ea09
Author:     Mark Jansen <[email protected]>
AuthorDate: Fri Dec 28 19:27:09 2018 +0100
Commit:     Mark Jansen <[email protected]>
CommitDate: Thu Jan 3 22:52:18 2019 +0100

    [LDR] Actually allocate what is asked for
---
 dll/ntdll/ldr/ldrutils.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dll/ntdll/ldr/ldrutils.c b/dll/ntdll/ldr/ldrutils.c
index 5b6e26abd9..4aa1cfb1c1 100644
--- a/dll/ntdll/ldr/ldrutils.c
+++ b/dll/ntdll/ldr/ldrutils.c
@@ -52,7 +52,7 @@ LdrpAllocateUnicodeString(IN OUT PUNICODE_STRING StringOut,
     /* Allocate the string*/
     StringOut->Buffer = RtlAllocateHeap(LdrpHeap,
                                         0,
-                                        StringOut->Length + sizeof(WCHAR));
+                                        Length + sizeof(WCHAR));
     if (!StringOut->Buffer)
     {
         /* Fail */
@@ -61,13 +61,13 @@ LdrpAllocateUnicodeString(IN OUT PUNICODE_STRING StringOut,
     }
 
     /* Null-terminate it */
-    StringOut->Buffer[StringOut->Length / sizeof(WCHAR)] = UNICODE_NULL;
+    StringOut->Buffer[Length / sizeof(WCHAR)] = UNICODE_NULL;
 
     /* Check if this is a maximum-sized string */
-    if (StringOut->Length != UNICODE_STRING_MAX_BYTES)
+    if (Length != UNICODE_STRING_MAX_BYTES)
     {
         /* It's not, so set the maximum length to be one char more */
-        StringOut->MaximumLength = StringOut->Length + sizeof(UNICODE_NULL);
+        StringOut->MaximumLength = Length + sizeof(UNICODE_NULL);
     }
     else
     {

Reply via email to