Module: wine Branch: master Commit: d263ba97fb7c9ada7ae847909f35cbf5db671216 URL: https://source.winehq.org/git/wine.git/?a=commit;h=d263ba97fb7c9ada7ae847909... Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Aug 29 12:36:58 2019 +0200 dbghelp: Prevent an invalid memory access when the search path element is empty. Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dbghelp/path.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index a0fc0cf..f8a7f3d 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)