Commit 1a6deb1c authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

tasklist: Fix a possible buffer overrun (Coverity).

process_entry->szExeFile has length of MAX_PATH but info->image_name only has 32.
parent eeb1826c
...@@ -176,7 +176,7 @@ static BOOL tasklist_get_process_info(const PROCESSENTRY32W *process_entry, stru ...@@ -176,7 +176,7 @@ static BOOL tasklist_get_process_info(const PROCESSENTRY32W *process_entry, stru
info->pid_value = process_entry->th32ProcessID; info->pid_value = process_entry->th32ProcessID;
info->memory_usage_value = memory_counters.WorkingSetSize / 1024; info->memory_usage_value = memory_counters.WorkingSetSize / 1024;
info->session_id_value = session_id; 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); swprintf(info->pid, ARRAY_SIZE(info->pid), L"%u", process_entry->th32ProcessID);
wcscpy(info->session_name, session_id == 0 ? L"Services" : L"Console"); wcscpy(info->session_name, session_id == 0 ? L"Services" : L"Console");
swprintf(info->session_number, ARRAY_SIZE(info->session_number), L"%u", session_id); swprintf(info->session_number, ARRAY_SIZE(info->session_number), L"%u", session_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment