Author: pschweitzer Date: Thu Feb 19 19:15:46 2015 New Revision: 66358
URL: http://svn.reactos.org/svn/reactos?rev=66358&view=rev Log: [KERNEL32] OK, Thomas had to convince me that MAX_USHORT + MAX_USHORT + 0x400 + 0x6 cannot overflow an ULONG. So remove useless check. By Thomas :-)
Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] Thu Feb 19 19:15:46 2015 @@ -93,12 +93,6 @@
/* 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 @@ 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);