Author: cwittich
Date: Wed Feb 4 13:16:51 2009
New Revision: 39395
URL:
http://svn.reactos.org/svn/reactos?rev=39395&view=rev
Log:
add a buffer length check (fixes one service test)
Modified:
trunk/reactos/base/system/services/rpcserver.c
Modified: trunk/reactos/base/system/services/rpcserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Wed Feb 4 13:16:51 2009
@@ -4251,7 +4251,14 @@
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));