Commit 6027fe2d authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

advapi32: Validate arguments in StartServiceCtrlDispatcher.

parent e17cdb26
......@@ -565,6 +565,12 @@ BOOL WINAPI StartServiceCtrlDispatcherA( const SERVICE_TABLE_ENTRYA *servent )
return FALSE;
}
while (servent[nb_services].lpServiceName) nb_services++;
if (!nb_services)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
for (i = 0; i < nb_services; i++)
......@@ -610,6 +616,12 @@ BOOL WINAPI StartServiceCtrlDispatcherW( const SERVICE_TABLE_ENTRYW *servent )
return FALSE;
}
while (servent[nb_services].lpServiceName) nb_services++;
if (!nb_services)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
for (i = 0; i < nb_services; i++)
......
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