From a0df5af7248f31bab8a799268e35373936d5911c Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gómez Date: Tue, 5 Nov 2019 11:31:24 +0100 Subject: #915 Validate POST /hardware REST API parameters This patch ensures that all required parameters are sent in the request. --- admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'admin') diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp index dc6aa129..db95298c 100644 --- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp +++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp @@ -3954,6 +3954,9 @@ static int og_cmd_hardware(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, "InventarioHardware", CLIENTE_OCUPADO); } -- cgit v1.2.3-18-g5258