bugfix: smbiosmdrv2handler: sizeof(pointer)
[src/smbiosmdrv2handler.cpp:570]:
[src/smbiosmdrv2handler.cpp:1002]:
[src/smbiosmdrv2handler.cpp:1112]:
(warning) Using 'sizeof' on array given as function argument returns
size of a pointer.
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: Ib311a970e324f24769064dc2ad47a8c3be1ca420
diff --git a/src/smbiosmdrv2handler.cpp b/src/smbiosmdrv2handler.cpp
index 52d23ad..1f5201d 100644
--- a/src/smbiosmdrv2handler.cpp
+++ b/src/smbiosmdrv2handler.cpp
@@ -567,7 +567,7 @@
return ipmi::responseParmOutOfRange();
}
- int idIndex = mdrv2->findDataId(dataInfo.data(), sizeof(dataInfo), service);
+ int idIndex = mdrv2->findDataId(dataInfo.data(), dataInfo.size(), service);
if ((idIndex < 0) || (idIndex >= maxDirEntries))
{
@@ -999,7 +999,7 @@
std::shared_ptr<sdbusplus::asio::connection> bus = getSdBus();
std::string service = ipmi::getService(*bus, mdrv2Interface, mdrv2Path);
- int idIndex = mdrv2->findDataId(dataInfo.data(), sizeof(dataInfo), service);
+ int idIndex = mdrv2->findDataId(dataInfo.data(), dataInfo.size(), service);
if ((idIndex < 0) || (idIndex >= maxDirEntries))
{
@@ -1109,7 +1109,7 @@
return ipmi::responseParmOutOfRange();
}
- int idIndex = mdrv2->findDataId(dataInfo.data(), sizeof(dataInfo), service);
+ int idIndex = mdrv2->findDataId(dataInfo.data(), dataInfo.size(), service);
if ((idIndex < 0) || (idIndex >= maxDirEntries))
{