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
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_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;