[KERNEL32]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 19 Feb 2015 19:15:46 +0000 (19:15 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 19 Feb 2015 19:15:46 +0000 (19:15 +0000)
OK, Thomas had to convince me that MAX_USHORT + MAX_USHORT + 0x400 + 0x6 cannot overflow an ULONG.
So remove useless check.
By Thomas :-)

svn path=/trunk/; revision=66358

reactos/dll/win32/kernel32/client/file/move.c

index e71405b..be12927 100644 (file)
@@ -93,12 +93,6 @@ BasepMoveFileDelayed(IN PUNICODE_STRING ExistingPath,
 
     /* Reserve enough to read previous string + to append our with required null chars */
     BufferLength = NewPath->Length + ExistingPath->Length + STRING_LENGTH + 3 * sizeof(UNICODE_NULL);
-    /* Check we didn't overflow */
-    if (BufferLength < STRING_LENGTH)
-    {
-        NtClose(KeyHandle);
-        return STATUS_BUFFER_TOO_SMALL;
-    }
 
     while (TRUE)
     {
@@ -123,6 +117,7 @@ BasepMoveFileDelayed(IN PUNICODE_STRING ExistingPath,
         StringLength = DataSize;
         RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
         BufferLength = ExistingPath->Length + StringLength + NewPath->Length + 3 * sizeof(UNICODE_NULL);
+        /* Check we didn't overflow */
         if (BufferLength < StringLength)
         {
             NtClose(KeyHandle);