Check reserved fields in appSlotI2CMasterWriteRead
Reserved field checking was not present, so this adds a check to make
sure that ther reserved fields do not have bits set. Also fixes a typo
for the reserved field name.
Tested: Run a slot i2c write read command that has a bit set in the
reserved field and see that it gets rejected.
Change-Id: I7f63cc71b97f4864c8dc59738a240630e388120e
Signed-off-by: Vernon Mauery <vernon.mauery@linux.intel.com>
diff --git a/src/manufacturingcommands.cpp b/src/manufacturingcommands.cpp
index 6aed0e9..42185a7 100644
--- a/src/manufacturingcommands.cpp
+++ b/src/manufacturingcommands.cpp
@@ -1131,9 +1131,13 @@
ipmi::RspType<std::vector<uint8_t>>
appSlotI2CMasterWriteRead(uint6_t reserved, uint2_t addressType,
uint3_t bbSlotNum, uint3_t riserSlotNum,
- uint2_t resvered2, uint8_t slaveAddr,
+ uint2_t reserved2, uint8_t slaveAddr,
uint8_t readCount, std::vector<uint8_t> writeData)
{
+ if (reserved || reserved2)
+ {
+ return ipmi::responseInvalidFieldRequest();
+ }
const size_t writeCount = writeData.size();
std::string i2cBus;
if (addressType == slotAddressTypeBus)