forked from Mirrors/wine-wine
advapi32: Validate arguments in StartServiceCtrlDispatcher.
parent
e17cdb266d
commit
6027fe2daf
|
@ -565,6 +565,12 @@ BOOL WINAPI StartServiceCtrlDispatcherA( const SERVICE_TABLE_ENTRYA *servent )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
while (servent[nb_services].lpServiceName) nb_services++;
|
while (servent[nb_services].lpServiceName) nb_services++;
|
||||||
|
if (!nb_services)
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
|
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
|
||||||
|
|
||||||
for (i = 0; i < nb_services; i++)
|
for (i = 0; i < nb_services; i++)
|
||||||
|
@ -610,6 +616,12 @@ BOOL WINAPI StartServiceCtrlDispatcherW( const SERVICE_TABLE_ENTRYW *servent )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
while (servent[nb_services].lpServiceName) nb_services++;
|
while (servent[nb_services].lpServiceName) nb_services++;
|
||||||
|
if (!nb_services)
|
||||||
|
{
|
||||||
|
SetLastError( ERROR_INVALID_PARAMETER );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
|
services = HeapAlloc( GetProcessHeap(), 0, nb_services * sizeof(*services) );
|
||||||
|
|
||||||
for (i = 0; i < nb_services; i++)
|
for (i = 0; i < nb_services; i++)
|
||||||
|
|
Loading…
Reference in New Issue