summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2019-11-05 11:06:05 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2019-11-06 11:26:06 +0100
commit04a8c17d711fbd7cd1e2761b1b15cee4afc7cbb2 (patch)
tree7952e7d72bd59d887ae9017f6c81ebf26012a56b
parentd86ddce3f5b16436849a764f6fc854b8fe37dccf (diff)
#915 Validate POST /stop REST API parameters
This patch ensures that all required parameters are sent in the request.
-rw-r--r--admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
index 3770ec95..3576f7ff 100644
--- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
+++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
@@ -3928,6 +3928,9 @@ static int og_cmd_stop(json_t *element, struct og_msg_params *params)
break;
}
+ if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR))
+ return -1;
+
return og_cmd_legacy_send(params, "Purgar", CLIENTE_APAGADO);
}