1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

tasklist: Fix a possible buffer overrun (Coverity).

process_entry->szExeFile has length of MAX_PATH but info->image_name only has 32.
This commit is contained in:
Zhiyi Zhang 2023-12-02 23:16:05 +08:00 committed by Alexandre Julliard
parent eeb1826c3f
commit 1a6deb1cc3

View File

@ -176,7 +176,7 @@ static BOOL tasklist_get_process_info(const PROCESSENTRY32W *process_entry, stru
info->pid_value = process_entry->th32ProcessID;
info->memory_usage_value = memory_counters.WorkingSetSize / 1024;
info->session_id_value = session_id;
wcscpy(info->image_name, process_entry->szExeFile);
lstrcpynW(info->image_name, process_entry->szExeFile, ARRAY_SIZE(info->image_name));
swprintf(info->pid, ARRAY_SIZE(info->pid), L"%u", process_entry->th32ProcessID);
wcscpy(info->session_name, session_id == 0 ? L"Services" : L"Console");
swprintf(info->session_number, ARRAY_SIZE(info->session_number), L"%u", session_id);