1 Star 0 Fork 17

liubuguiii/src-kiran-cc-daemon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0018-fix-systeminfo-fix-the-graphical-and-network-hardwar.patch 1.67 KB
一键复制 编辑 原始数据 按行查看 历史
From 5f64a588c8518aada0c2c8fb73f6ee753eef8f98 Mon Sep 17 00:00:00 2001
From: tangjie02 <tangjie02@kylinsec.com.cn>
Date: Thu, 4 Jul 2024 13:31:05 +0800
Subject: [PATCH 18/22] fix(systeminfo): fix the graphical and network hardware
info no display problem
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复由于placehold1数组大小太小导致读取显卡和网络信息错误问题
Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
---
plugins/systeminfo/systeminfo-hardware.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/systeminfo/systeminfo-hardware.cpp b/plugins/systeminfo/systeminfo-hardware.cpp
index 917afe1..73960f7 100644
--- a/plugins/systeminfo/systeminfo-hardware.cpp
+++ b/plugins/systeminfo/systeminfo-hardware.cpp
@@ -26,7 +26,7 @@ namespace Kiran
#define CPUINFO_FILE "/proc/cpuinfo"
#define CPUINFO_KEY_DELIMITER ':'
#define CPUINFO_KEY_MODEL "model name"
-//龙芯cpuinfo中为大写
+// 龙芯cpuinfo中为大写
#define CPUINFO_KEY_MODEL_LS "Model Name"
#define CPUINFO_KEY_PROCESSOR "processor"
@@ -340,9 +340,9 @@ KVList SystemInfoHardware::get_pcis_by_major_class_id(PCIMajorClassID major_clas
auto lines = StrUtils::split_lines(cmd_output);
for (auto& line : lines)
{
- char placehold1[10];
+ char placehold1[50];
unsigned int full_class_id;
- if (sscanf(line.c_str(), "%9s %x:", placehold1, &full_class_id) == 2)
+ if (sscanf(line.c_str(), "%49s %x:", placehold1, &full_class_id) == 2)
{
if ((full_class_id >> 8) == major_class_id)
{
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liubuguiii/src-kiran-cc-daemon.git
git@gitee.com:liubuguiii/src-kiran-cc-daemon.git
liubuguiii
src-kiran-cc-daemon
src-kiran-cc-daemon
master

搜索帮助