Author: tfaber Date: Sat Sep 14 09:12:12 2013 New Revision: 60093
URL: http://svn.reactos.org/svn/reactos?rev=60093&view=rev Log: [KERNEL32] - Fix an off-by-one in the UNC case in WaitNamedPipeW - Some readability
Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c
Modified: trunk/reactos/dll/win32/kernel32/client/file/npipe.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/f... ============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/npipe.c [iso-8859-1] Sat Sep 14 09:12:12 2013 @@ -415,8 +415,9 @@ }
/* Move past it */ - NewName.Buffer += 9; - NewName.Length -= 9 * sizeof(WCHAR); + NewName.Buffer += PipePrefix.Length / sizeof(WCHAR); + NewName.Length -= PipePrefix.Length; + NewName.MaximumLength -= PipePrefix.Length;
/* Initialize the Dos Devices name */ TRACE("NewName: %wZ\n", &NewName); @@ -438,10 +439,10 @@ } while (*p);
/* Now make sure the full name contains "pipe" */ - if ((*p) && !(_wcsnicmp(p + 1, L"pipe\", sizeof("pipe\")))) + if ((*p) && !(_wcsnicmp(p + 1, L"pipe\", sizeof("pipe\") - sizeof(ANSI_NULL)))) { /* Get to the pipe name itself now */ - p += sizeof("pipe\") - 1; + p += sizeof("pipe\") - sizeof(ANSI_NULL); } else {