dbghelp: Prevent an invalid memory access when the search path element is empty.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2019-08-29 12:36:58 +02:00 committed by Alexandre Julliard
parent e3a7c603e1
commit d263ba97fb
1 changed files with 1 additions and 0 deletions

View File

@ -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)