Commit 74e2cfb6 authored by Troy Rollo's avatar Troy Rollo Committed by Alexandre Julliard

Correct incorrect use of arguments to QueryServiceConfigW.

parent 5b432751
......@@ -1803,15 +1803,15 @@ QueryServiceConfigW( 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