mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/win32-vd_agent
synced 2025-12-26 21:37:53 +00:00
Prevent possible future buffer overflow
event_type should come only with specific values but this in theory can change in the future. To prevent overflows (just for logging) check value size against lookup array. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
This commit is contained in:
parent
8512940e53
commit
f00fe84cc3
@ -284,7 +284,8 @@ DWORD WINAPI VDService::control_handler(DWORD control, DWORD event_type, LPVOID
|
||||
break;
|
||||
case SERVICE_CONTROL_SESSIONCHANGE: {
|
||||
DWORD session_id = ((WTSSESSION_NOTIFICATION*)event_data)->dwSessionId;
|
||||
vd_printf("Session %lu %s", session_id, session_events[event_type]);
|
||||
vd_printf("Session %lu %s", session_id,
|
||||
event_type < ARRAYSIZE(session_events) ? session_events[event_type]: "unknown");
|
||||
SetServiceStatus(s->_status_handle, &s->_status);
|
||||
if (event_type == WTS_CONSOLE_CONNECT) {
|
||||
s->_session_id = session_id;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user