Zebediah Figura : ws2_32: Correctly null-terminate the addrinfo chain.

Alexandre Julliard julliard at winehq.org
Wed Dec 29 16:04:18 CST 2021


Module: wine
Branch: master
Commit: 9947a8d0de8dfa6bd3ca860940e94aa3dc91019b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9947a8d0de8dfa6bd3ca860940e94aa3dc91019b

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Dec 29 12:38:53 2021 -0600

ws2_32: Correctly null-terminate the addrinfo chain.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52288
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ws2_32/unixlib.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/ws2_32/unixlib.c b/dlls/ws2_32/unixlib.c
index e89ebe35248..56a0bed308d 100644
--- a/dlls/ws2_32/unixlib.c
+++ b/dlls/ws2_32/unixlib.c
@@ -752,6 +752,7 @@ static NTSTATUS unix_getaddrinfo( void *args )
         dst->ai_addrlen = sockaddr_from_unix( (const union unix_sockaddr *)src->ai_addr, NULL, 0 );
         dst->ai_addr = next;
         sockaddr_from_unix( (const union unix_sockaddr *)src->ai_addr, dst->ai_addr, dst->ai_addrlen );
+        dst->ai_next = NULL;
         next = (char *)dst->ai_addr + dst->ai_addrlen;
 
         if (dst == params->info || !addrinfo_in_list( params->info, dst ))
@@ -763,8 +764,6 @@ static NTSTATUS unix_getaddrinfo( void *args )
         }
     }
 
-    dst->ai_next = NULL;
-
     freeaddrinfo( unix_info );
     return 0;
 #else




More information about the wine-cvs mailing list