From 52a9243317f90cc15ce709a096dd3da134e40c63 Mon Sep 17 00:00:00 2001 From: Thad House Date: Thu, 17 Oct 2024 12:36:07 -0700 Subject: [PATCH] win: Fix linked list logic in getaddrinfo (#4578) The logic in #4254 is incorrect, and results in the addrinfo linked list only having a single result. Fix this by correcting the logic. Closes #4577 --- src/win/getaddrinfo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/win/getaddrinfo.c b/src/win/getaddrinfo.c index f20e10d4..4b8ee75a 100644 --- a/src/win/getaddrinfo.c +++ b/src/win/getaddrinfo.c @@ -191,8 +191,9 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) { if (addrinfow_ptr == NULL) break; cur_off = align_offset(cur_off, sizeof(void *)); - addrinfo_ptr = (struct addrinfo *)(alloc_ptr + cur_off); - addrinfo_ptr->ai_next = addrinfo_ptr; + struct addrinfo *next_addrinfo_ptr = (struct addrinfo *)(alloc_ptr + cur_off); + addrinfo_ptr->ai_next = next_addrinfo_ptr; + addrinfo_ptr = next_addrinfo_ptr; } req->addrinfo = (struct addrinfo*)alloc_ptr; } else {