mstflint/SOURCES/0001-mstflint-crash-when-compiled-with-CXXFLAGS-Wp-D_GLIB.patch
2021-09-09 22:30:12 +00:00

27 lines
1.2 KiB
Diff

From cef28b2989c4df76869ca0d71322c099134774ab Mon Sep 17 00:00:00 2001
From: root <root@apps-62.mtl.labs.mlnx>
Date: Sun, 10 Feb 2019 14:25:44 +0200
Subject: [PATCH] mstflint crash when compiled with
'CXXFLAGS='-Wp,-D_GLIBCXX_ASSERTIONS''
---
mlxfwops/lib/fs3_ops.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mlxfwops/lib/fs3_ops.cpp b/mlxfwops/lib/fs3_ops.cpp
index bfe8adb..55f2b71 100644
--- a/mlxfwops/lib/fs3_ops.cpp
+++ b/mlxfwops/lib/fs3_ops.cpp
@@ -525,7 +525,7 @@ bool Fs3Operations::VerifyTOC(u_int32_t dtoc_addr, bool &bad_signature, VerifyCa
}
// Only when we have full verify or the info of this section should be collected for query
std::vector<u_int8_t> buffv(entry_size_in_bytes);
- u_int8_t *buff = (u_int8_t *)(&(buffv[0]));
+ u_int8_t *buff = (u_int8_t *)(buffv.size() ? (&(buffv[0])) : NULL);
if (show_itoc) {
cibfw_itoc_entry_dump(&toc_entry, stdout);
if (!DumpFs3CRCCheck(toc_entry.type, phys_addr, entry_size_in_bytes, 0, 0, true, verifyCallBackFunc)) {
--
2.20.1