加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-sd-boot-Fix-possible-null-pointer-dereference.patch 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
From 872d101c2308e07c523fd6ca84bd774447f05b7e Mon Sep 17 00:00:00 2001
From: Jan Janssen <medhefgo@web.de>
Date: Wed, 11 Aug 2021 14:59:46 +0200
Subject: [PATCH] sd-boot: Fix possible null pointer dereference
Auto entries are showing garbage for the version in print_status()
because StrDuplicate does not expect null pointers.
(cherry picked from commit b52fafb26d90b77cfc259fcbdab3c95a571bacb1)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/872d101c2308e07c523fd6ca84bd774447f05b7e
---
src/boot/efi/boot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
index 3249171ec1..13940a6df7 100644
--- a/src/boot/efi/boot.c
+++ b/src/boot/efi/boot.c
@@ -1724,7 +1724,7 @@ static ConfigEntry *config_entry_add_loader(
*entry = (ConfigEntry) {
.type = type,
.title = StrDuplicate(title),
- .version = StrDuplicate(version),
+ .version = version ? StrDuplicate(version) : NULL,
.device = device,
.loader = StrDuplicate(loader),
.id = StrDuplicate(id),
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化