代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/grub2 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <[email protected]>
Date: Tue, 4 Dec 2018 10:53:49 +0100
Subject: [PATCH] Fix get_entry_number() wrongly dereferencing the tail pointer
The get_entry_number_helper() function attempts to lookup a boot entry by
either title or id matching the value of an environment variable. If they
are a substring of the variable, the tail pointer is set to the first char
of the remainder of the string.
When get_entry_number() calls this function, it checks if this first char
is a NUL byte, to know if the variable matched correctly. But tail can be
set to NULL as well to indicate that there isn't a remainder in the string.
Resolves: rhbz#1654936
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
grub-core/normal/menu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c
index fc25c702f..7e32c498a 100644
--- a/grub-core/normal/menu.c
+++ b/grub-core/normal/menu.c
@@ -563,7 +563,7 @@ get_entry_number (grub_menu_t menu, const char *name)
grub_error_push ();
entry = get_entry_number_helper(menu, val, &tail);
- if (*tail != '\0')
+ if (tail && *tail != '\0')
entry = -1;
grub_error_pop ();
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。