Module: wine Branch: master Commit: 7475ecac530f81bf66338fa49f01839f352ae87e URL: http://source.winehq.org/git/wine.git/?a=commit;h=7475ecac530f81bf66338fa49f...
Author: Alexandre Julliard julliard@winehq.org Date: Fri Oct 19 14:40:23 2007 +0200
ntdll: Fixed off-by-one error in RtlGetFullPathName_U (spotted by Michael Builov).
---
dlls/ntdll/path.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c index 6f161a3..db4cd10 100644 --- a/dlls/ntdll/path.c +++ b/dlls/ntdll/path.c @@ -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);