Commit 7475ecac authored by Alexandre Julliard's avatar Alexandre Julliard

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

parent 88829360
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment