Commit 63c36da6 authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

advapi32: Hold lock while processing service controls.

parent f4590e91
...@@ -461,6 +461,8 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg) ...@@ -461,6 +461,8 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
} }
} }
EnterCriticalSection( &service_cs );
/* validate service name */ /* validate service name */
name = (WCHAR *)data; name = (WCHAR *)data;
if (!info.name_size || data_size < info.name_size * sizeof(WCHAR) || name[info.name_size - 1]) if (!info.name_size || data_size < info.name_size * sizeof(WCHAR) || name[info.name_size - 1])
...@@ -504,6 +506,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg) ...@@ -504,6 +506,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
} }
done: done:
LeaveCriticalSection( &service_cs );
WriteFile( disp->pipe, &result, sizeof(result), &count, NULL ); WriteFile( disp->pipe, &result, sizeof(result), &count, NULL );
heap_free( data ); heap_free( data );
} }
......
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