代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ipmitool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 6d515dd06bcb89598465cc69e89e37684577e289 Mon Sep 17 00:00:00 2001
From: Patrick Venture <venture@google.com>
Date: Mon, 26 Nov 2018 12:38:04 -0800
Subject: [PATCH 098/119] fru: fixup array bounds checking
Fixup the following array bounds checking bugs:
[lib/ipmi_fru.c:1003]: (style) Array index 'i' is
used before limits check.
[lib/ipmi_fru.c:1127]: (style) Array index 'i' is
used before limits check.
[lib/ipmi_fru.c:1262]: (style) Array index 'i' is
used before limits check.
Signed-off-by: Patrick Venture <venture@google.com>
---
include/ipmitool/ipmi_fru.h | 2 ++
lib/ipmi_fru.c | 9 +++------
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/include/ipmitool/ipmi_fru.h b/include/ipmitool/ipmi_fru.h
index 65696ba..c543efc 100644
--- a/include/ipmitool/ipmi_fru.h
+++ b/include/ipmitool/ipmi_fru.h
@@ -41,6 +41,8 @@
# include <config.h>
#endif
+#define FRU_END_OF_FIELDS 0xc1
+
#define GET_FRU_INFO 0x10
#define GET_FRU_DATA 0x11
#define SET_FRU_DATA 0x12
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 6115ae6..5057dc3 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -957,8 +957,7 @@ fru_area_print_chassis(struct ipmi_intf * intf, struct fru_info * fru,
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
if (fru_area != NULL) {
@@ -1083,8 +1082,7 @@ fru_area_print_board(struct ipmi_intf * intf, struct fru_info * fru,
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
if (fru_area != NULL) {
@@ -1218,8 +1216,7 @@ fru_area_print_product(struct ipmi_intf * intf, struct fru_info * fru,
}
/* read any extra fields */
- while ((fru_data[i] != 0xc1) && (i < fru_len))
- {
+ while ((i < fru_len) && (fru_data[i] != FRU_END_OF_FIELDS)) {
int j = i;
fru_area = get_fru_area_str(fru_data, &i);
if (fru_area != NULL) {
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。