[PATCH] dbghelp: Prevent an invalid memory access when the search path element is empty
29 Aug
2019
29 Aug
'19
10:36 a.m.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> --- dlls/dbghelp/path.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index a0fc0cf5b17..f8a7f3d890a 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -229,6 +229,7 @@ static BOOL do_searchW(PCWSTR file, PWSTR buffer, BOOL recurse, static const WCHAR S_DotDotW[] = {'.','.','\0'}; pos = strlenW(buffer); + if (pos == 0) return FALSE; if (buffer[pos - 1] != '\\') buffer[pos++] = '\\'; strcpyW(buffer + pos, S_AllW); if ((h = FindFirstFileW(buffer, &fd)) == INVALID_HANDLE_VALUE) -- 2.23.0.rc1
2387
Age (days ago)
2387
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rémi Bernon