1 Star 0 Fork 160

Andy Lau/glibc

forked from src-openEuler/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-elf-avoid-jumping-over-a-needed-declaration.patch 1.33 KB
一键复制 编辑 原始数据 按行查看 历史
桐小哥 提交于 2024-11-29 11:17 +08:00 . sync some patches
From 8e572067976ea700e5ef750458c42c47328fe459 Mon Sep 17 00:00:00 2001
From: DJ Delorie <dj@redhat.com>
Date: Wed, 6 Nov 2024 21:40:35 -0500
Subject: [PATCH] elf: avoid jumping over a needed declaration
The declaration of found_other_class could be jumped
over via the goto just above it, but the code jumped
to uses found_other_class. Move the declaration
up a bit to ensure it's properly declared and initialized.
---
elf/dl-load.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index ac8e217a7f..335b34c56d 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1931,6 +1931,9 @@ _dl_map_object (struct link_map *loader, const char *name,
: "\nfile=%s [%lu]; dynamically loaded by %s [%lu]\n",
name, nsid, DSO_FILENAME (loader->l_name), loader->l_ns);
+ /* Will be true if we found a DSO which is of the other ELF class. */
+ bool found_other_class = false;
+
#ifdef SHARED
/* Give the auditing libraries a chance to change the name before we
try anything. */
@@ -1948,9 +1951,6 @@ _dl_map_object (struct link_map *loader, const char *name,
}
#endif
- /* Will be true if we found a DSO which is of the other ELF class. */
- bool found_other_class = false;
-
if (strchr (name, '/') == NULL)
{
/* Search for NAME in several places. */
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wilhelmleibniz/glibc.git
git@gitee.com:wilhelmleibniz/glibc.git
wilhelmleibniz
glibc
glibc
master

搜索帮助

371d5123 14472233 46e8bd33 14472233