1 Star 0 Fork 70

mds.lanruo/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libvirt-util-fix-iteration-in-virSocketAddrResolveService.patch 1019 Bytes
一键复制 编辑 原始数据 按行查看 历史
From 9056229f9dff923406d97f0ac295bd502eaa5265 Mon Sep 17 00:00:00 2001
From: Nikolay Shirokovskiy <[email protected]>
Date: Mon, 13 Apr 2020 16:48:43 +0300
Subject: [PATCH 2/8] util: fix iteration in virSocketAddrResolveService
getaddrinfo returns linked list. Fix iteration accordingly.
Signed-off-by: Nikolay Shirokovskiy <[email protected]>
Reviewed-by: Daniel Henrique Barboza <[email protected]>
(cherry-picked from commit a13ac587)
Signed-off-by: AlexChen <[email protected]>
---
src/util/virsocketaddr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c
index 4cad329d15..4c9f124e88 100644
--- a/src/util/virsocketaddr.c
+++ b/src/util/virsocketaddr.c
@@ -271,7 +271,7 @@ int virSocketAddrResolveService(const char *service)
port = ntohs(in.sin6_port);
goto cleanup;
}
- tmp++;
+ tmp = tmp->ai_next;
}
virReportError(VIR_ERR_SYSTEM_ERROR,
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mdslanruo/libvirt.git
[email protected]:mdslanruo/libvirt.git
mdslanruo
libvirt
libvirt
master

搜索帮助