11 Star 76 Fork 100

OpenHarmony / third_party_lwip

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
0008-gazelle-fix-lwip_accept-memcpy-sockaddr-large.patch 741 Bytes
一键复制 编辑 原始数据 按行查看 历史
Aurora 提交于 2023-12-07 03:26 . update lwip to 2.1.3-39.oe2203sp1
From bf1c7febb9f6c3a2336f18f658694393dea451ae Mon Sep 17 00:00:00 2001
From: jiangheng <jiangheng12@huawei.com>
Date: Fri, 16 Jul 2021 14:44:03 +0800
Subject: [PATCH] [Huawei]gazelle: fix lwip_accept memcpy sockaddr larger than
actual
---
src/api/sockets.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index eccc7f9..e640945 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -860,6 +860,8 @@ lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
if (*addrlen > tempaddr.sa.sa_len) {
*addrlen = tempaddr.sa.sa_len;
}
+#else
+ *addrlen = LWIP_MIN(*addrlen, sizeof(tempaddr));
#endif /* USE_LIBOS */
MEMCPY(addr, &tempaddr, *addrlen);
--
2.23.0
1
https://gitee.com/openharmony/third_party_lwip.git
git@gitee.com:openharmony/third_party_lwip.git
openharmony
third_party_lwip
third_party_lwip
master

搜索帮助