diff --git a/mlxfwops/lib/fs2_ops.cpp b/mlxfwops/lib/fs2_ops.cpp index 775e242..4af0b9f 100644 --- a/mlxfwops/lib/fs2_ops.cpp +++ b/mlxfwops/lib/fs2_ops.cpp @@ -369,7 +369,7 @@ bool Fs2Operations::checkGen(u_int32_t beg, u_int32_t offs, u_int32_t& next, con // CRC Crc16 crc; std::vector buffv(size); - u_int32_t *buff = (u_int32_t*)(&(buffv[0])); + u_int32_t *buff = (u_int32_t*)(buffv.size() ? (&(buffv[0])) : NULL); readBufAux((*_ioAccess), offs + sizeof(gph), buff, size, pr); diff --git a/mlxfwops/lib/fs4_ops.cpp b/mlxfwops/lib/fs4_ops.cpp index eb0ca29..4b10307 100644 --- a/mlxfwops/lib/fs4_ops.cpp +++ b/mlxfwops/lib/fs4_ops.cpp @@ -403,7 +403,7 @@ bool Fs4Operations::verifyTocEntries(u_int32_t tocAddr, bool show_itoc, bool isD // Only when we have full verify or the info of this section should be collected for query std::vector buffv(entrySizeInBytes); - u_int8_t *buff = (u_int8_t *)(&(buffv[0])); + u_int8_t *buff = (u_int8_t *)(buffv.size() ? (&(buffv[0])) : NULL); if (show_itoc) { cx5fw_itoc_entry_dump(&tocEntry, stdout);