add a buffer length check (fixes one service test)

svn path=/trunk/; revision=39395
This commit is contained in:
Christoph von Wittich 2009-02-04 19:16:51 +00:00
parent e1f736659a
commit f38aaf659b

View file

@ -4251,7 +4251,14 @@ DWORD RQueryServiceConfig2A(
L"Description",
&lpDescriptionW);
if (dwError != ERROR_SUCCESS)
{
if (cbBufSize < sizeof(SERVICE_DESCRIPTIONA))
{
*pcbBytesNeeded = sizeof(SERVICE_DESCRIPTIONA);
dwError = ERROR_INSUFFICIENT_BUFFER;
}
goto done;
}
dwRequiredSize = sizeof(SERVICE_DESCRIPTIONA) + ((wcslen(lpDescriptionW) + 1));