11 Star 76 Fork 99

OpenHarmony / third_party_lwip

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
0093-modfiy-accept-null-pointer-when-new-conn-receive-RST-packet-in-listening.patch 1.10 KB
Copy Edit Raw Blame History
Aurora authored 2024-03-28 16:36 . update lwip from 2.1.3-90 to 2.1.3-102
From dcdd7d73c6083a63fe966a68f11eddcafa3fd743 Mon Sep 17 00:00:00 2001
From: hantwofish <hankangkang5@huawei.com>
Date: Thu, 14 Dec 2023 14:51:37 +0800
Subject: [PATCH] resove null pointer
---
src/api/sockets.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/api/sockets.c b/src/api/sockets.c
index a9d39ae..0b3e4ea 100644
--- a/src/api/sockets.c
+++ b/src/api/sockets.c
@@ -801,15 +801,17 @@ lwip_accept4(int s, struct sockaddr *addr, socklen_t *addrlen, int flags)
#endif /* GAZELLE_ENABLE */
nsock = &sockets[newsock - LWIP_SOCKET_OFFSET];
#if GAZELLE_ENABLE
+ int ret = 0;
struct tcp_pcb *pcb = newconn->pcb.tcp;
- if (pcb->client_rx_ring != NULL && pcb->client_tx_ring != NULL) {
- if (find_same_node_memzone(pcb, nsock) != 0) {
+ if (pcb != NULL && pcb->client_rx_ring != NULL && pcb->client_tx_ring != NULL) {
+ ret = find_same_node_memzone(pcb, nsock);
+ }
+ if (pcb == NULL || ret != 0) {
netconn_delete(newconn);
free_socket(nsock, 1);
sock_set_errno(sock, ENOTCONN);
done_socket(sock);
return -1;
- }
}
#endif
--
2.33.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

Search