summaryrefslogtreecommitdiffstats
path: root/app/watchdog.cpp
diff options
context:
space:
mode:
authorYu Ren <yux.ren@intel.com>2019-05-17 16:47:57 +0800
committerVernon Mauery <vernon.mauery@linux.intel.com>2019-05-20 17:28:46 +0000
commitfdb8389df74f9f0d6428252a75c33f6abf6d8481 (patch)
tree9919eacbe63c66a89e3ae1cfb12906c4b1420085 /app/watchdog.cpp
parent1554132bc08cf7b22777ae83c3ebd23997a61496 (diff)
downloadphosphor-host-ipmid-fdb8389df74f9f0d6428252a75c33f6abf6d8481.tar.gz
phosphor-host-ipmid-fdb8389df74f9f0d6428252a75c33f6abf6d8481.zip
Return error if the input data is larger than expected
If the input data length exceeds the expected, return len_invalid too Tested: ipmitool raw 0x06 0x24 0x01 0x13 0x0 0x2 0xa 0x00 0xff Will return error Signed-off-by: Yu Ren <yux.ren@intel.com> Change-Id: I12168f4aed51c499fd06067ca4475917b68e819e
Diffstat (limited to 'app/watchdog.cpp')
-rw-r--r--app/watchdog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/watchdog.cpp b/app/watchdog.cpp
index b1eea1c..25ca4b1 100644
--- a/app/watchdog.cpp
+++ b/app/watchdog.cpp
@@ -187,7 +187,7 @@ ipmi_ret_t ipmi_app_watchdog_set(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
ipmi_context_t context)
{
// Extract the request data
- if (*data_len < sizeof(wd_set_req))
+ if (*data_len != sizeof(wd_set_req))
{
*data_len = 0;
return IPMI_CC_REQ_DATA_LEN_INVALID;
OpenPOWER on IntegriCloud