https://git.reactos.org/?p=reactos.git;a=commitdiff;h=91a5ee334d3961157b1b5…
commit 91a5ee334d3961157b1b52140911ae1f03b6cc71
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Jul 22 12:45:23 2018 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Jul 22 12:45:23 2018 +0200
[SERVICES] Add a checks for vaild info level to RChangeServiceConfig2A/W and
RQueryServiceConfig2A/W
CORE-14837
---
base/system/services/rpcserver.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/base/system/services/rpcserver.c b/base/system/services/rpcserver.c
index 0d75aae927..2e6e8087f1 100644
--- a/base/system/services/rpcserver.c
+++ b/base/system/services/rpcserver.c
@@ -5104,6 +5104,10 @@ RChangeServiceConfig2A(
DPRINT("RChangeServiceConfig2A() called\n");
DPRINT("dwInfoLevel = %lu\n", Info.dwInfoLevel);
+ if ((Info.dwInfoLevel < SERVICE_CONFIG_DESCRIPTION) ||
+ (Info.dwInfoLevel > SERVICE_CONFIG_FAILURE_ACTIONS))
+ return ERROR_INVALID_LEVEL;
+
InfoW.dwInfoLevel = Info.dwInfoLevel;
if (InfoW.dwInfoLevel == SERVICE_CONFIG_DESCRIPTION)
@@ -5502,6 +5506,10 @@ RChangeServiceConfig2W(
if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS;
+ if ((Info.dwInfoLevel < SERVICE_CONFIG_DESCRIPTION) ||
+ (Info.dwInfoLevel > SERVICE_CONFIG_FAILURE_ACTIONS))
+ return ERROR_INVALID_LEVEL;
+
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
@@ -5638,6 +5646,10 @@ RQueryServiceConfig2A(
if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS;
+ if ((dwInfoLevel < SERVICE_CONFIG_DESCRIPTION) ||
+ (dwInfoLevel > SERVICE_CONFIG_FAILURE_ACTIONS))
+ return ERROR_INVALID_LEVEL;
+
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{
@@ -5876,6 +5888,10 @@ RQueryServiceConfig2W(
if (ScmShutdown)
return ERROR_SHUTDOWN_IN_PROGRESS;
+ if ((dwInfoLevel < SERVICE_CONFIG_DESCRIPTION) ||
+ (dwInfoLevel > SERVICE_CONFIG_FAILURE_ACTIONS))
+ return ERROR_INVALID_LEVEL;
+
hSvc = ScmGetServiceFromHandle(hService);
if (hSvc == NULL)
{