加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
0018-kpatch_storage-put-an-end-to-description-string-load.patch 729 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 3954dd43124e87c788352ccc528cc79e8fca6f6d Mon Sep 17 00:00:00 2001
From: YiFan <loyfan@users.noreply.github.com>
Date: Tue, 13 Aug 2019 11:02:36 +0800
Subject: [PATCH 18/89] kpatch_storage: put an end to description string loaded
Description string should be ended up with a '\0'.
---
src/kpatch_storage.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/kpatch_storage.c b/src/kpatch_storage.c
index a466460..2375559 100644
--- a/src/kpatch_storage.c
+++ b/src/kpatch_storage.c
@@ -377,8 +377,10 @@ char *storage_get_description(kpatch_storage_t *storage,
if (rv == -1)
goto err_free;
- if (rv == 0)
+ if (rv == 0) {
+ desc[sz] = '\0';
break;
+ }
sz += rv;
}
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化