ntdll: Fixed off-by-one error in RtlGetFullPathName_U (spotted by Michael Builov).

This commit is contained in:
Alexandre Julliard 2007-10-19 14:40:23 +02:00
parent 8882936073
commit 7475ecac53

View file

@ -809,7 +809,7 @@ DWORD WINAPI RtlGetFullPathName_U(const WCHAR* name, ULONG size, WCHAR* buffer,
{
LPWSTR tmp = RtlAllocateHeap(GetProcessHeap(), 0, reqsize);
reqsize = get_full_path_helper(name, tmp, reqsize);
if (reqsize > size) /* it may have worked the second time */
if (reqsize + sizeof(WCHAR) > size) /* it may have worked the second time */
{
RtlFreeHeap(GetProcessHeap(), 0, tmp);
return reqsize + sizeof(WCHAR);