代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/ipmitool 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 1245aaa387dca1cb99408869b2c1b3e2410a1352 Mon Sep 17 00:00:00 2001
From: Alexander Amelkin <alexander@amelkin.msk.ru>
Date: Tue, 15 Sep 2020 16:49:20 +0300
Subject: [PATCH] fru: Fix crashes on 6-bit ASCII strings
Fix calculation of the buffer size for decoded 6-bit ASCII
strings. Previously the program could allocate too a short buffer
that caused buffer overflows and segmentation fault crashes on
certain FRU contents.
Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
---
lib/ipmi_fru.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ipmi_fru.c b/lib/ipmi_fru.c
index 501ef26..3d1d8a1 100644
--- a/lib/ipmi_fru.c
+++ b/lib/ipmi_fru.c
@@ -175,8 +175,8 @@ char * get_fru_area_str(uint8_t * data, uint32_t * offset)
size = (len * 2);
break;
case 2: /* 10b: 6-bit ASCII */
- /* 4 chars per group of 1-3 bytes */
- size = (((len * 4 + 2) / 3) & ~3);
+ /* 4 chars per group of 1-3 bytes, round up to 4 bytes boundary */
+ size = (len / 3 + 1) * 4;
break;
case 3: /* 11b: 8-bit ASCII */
/* no length adjustment */
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。