From 00ff44e0d4bbb7eb1fbbc576bacfafa2e31e4414 Mon Sep 17 00:00:00 2001 From: "Ivan.Z" <53048645+chemodax@users.noreply.github.com> Date: Sun, 7 Jan 2024 12:52:24 +0100 Subject: [PATCH] Pass correct size to QueryFullProcessImageName() API call. --- src/pbench/pbench.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pbench/pbench.cpp b/src/pbench/pbench.cpp index 0bea649..a07a931 100644 --- a/src/pbench/pbench.cpp +++ b/src/pbench/pbench.cpp @@ -68,7 +68,7 @@ struct AdditionalProcessInfo AdditionalProcessInfo(HANDLE hProcess) : m_hProcess(hProcess) { - DWORD dw = MAX_PATH * sizeof(WCHAR); + DWORD dw = MAX_PATH; BOOL b = QueryFullProcessImageName(hProcess, 0, m_ImageFileName.GetBuffer(MAX_PATH), &dw); if (b) {