114 Star 0 Fork 29

src-openEuler/libuv

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0001-unix-ignore-ifaddrs-with-NULL-ifa_addr-4218.patch 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
Jingwiw 提交于 2023-11-27 22:26 . Upgrade to 1.47.0
From b963f0a75bd6c95fbfa0ac17e46ab1f9d1a787c4 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh@redhat.com>
Date: Tue, 14 Nov 2023 04:23:28 -0500
Subject: [PATCH 1/2] unix: ignore ifaddrs with NULL ifa_addr (#4218)
Passing this to uv__is_ipv6_link_local() is causing a segmentation
fault. Note that the documentation for getifaddrs() explicitly states
that this value may be NULL.
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
src/unix/tcp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/unix/tcp.c b/src/unix/tcp.c
index a6b53e5913271d0c83e1d7f7e4cb8140f5f3936d..29f4532e747db50146a8b821389f4d45304c5cd0 100644
--- a/src/unix/tcp.c
+++ b/src/unix/tcp.c
@@ -233,8 +233,9 @@ static int uv__ipv6_link_local_scope_id(void) {
return 0;
for (p = ifa; p != NULL; p = p->ifa_next)
- if (uv__is_ipv6_link_local(p->ifa_addr))
- break;
+ if (p->ifa_addr != NULL)
+ if (uv__is_ipv6_link_local(p->ifa_addr))
+ break;
rv = 0;
if (p != NULL) {
--
2.41.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libuv.git
git@gitee.com:src-openeuler/libuv.git
src-openeuler
libuv
libuv
master

搜索帮助