[PATCH] dbghelp: Prevent an invalid memory access when the search path element is empty

Rémi Bernon rbernon at codeweavers.com
Thu Aug 29 05:36:58 CDT 2019


Signed-off-by: Rémi Bernon <rbernon at 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




More information about the wine-devel mailing list