Commit 401d4cf4 authored by Alexander Yaworsky's avatar Alexander Yaworsky Committed by Alexandre Julliard

Correct incorrect use of arguments to QueryServiceConfigA. Spotted by

Troy Rollo.
parent 695f316c
......@@ -1655,15 +1655,15 @@ QueryServiceConfigA( SC_HANDLE hService,
if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) )
total += sz;
*pcbBytesNeeded = total;
/* if there's not enough memory, return an error */
if( total > *pcbBytesNeeded )
if( total > cbBufSize )
{
*pcbBytesNeeded = total;
SetLastError( ERROR_INSUFFICIENT_BUFFER );
return FALSE;
}
*pcbBytesNeeded = total;
ZeroMemory( lpServiceConfig, total );
sz = sizeof val;
......
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