[PATCH] ws2_32: Use correct buffer for 17 byte write (resubmit)

View: New views
1 Messages — Rating Filter:   Alert me  

[PATCH] ws2_32: Use correct buffer for 17 byte write (resubmit)

by Marcus Meissner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

stackprotector is unhappy that we write a 0 byte over the end
of the dst array. It should actually be dst6 here as inet_ntop
will write 16 characters + \0.

Ciao, Marcus
---
 dlls/ws2_32/tests/sock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
index 518ab4a..98b94e8 100644
--- a/dlls/ws2_32/tests/sock.c
+++ b/dlls/ws2_32/tests/sock.c
@@ -2443,7 +2443,7 @@ static void test_addr_to_print(void)
     /* Test longer length is ok */
     WSASetLastError(0);
     pdst = NULL;
-    pdst = pInetNtop(AF_INET6, (void*)&in6.s6_addr, dst, 18);
+    pdst = pInetNtop(AF_INET6, (void*)&in6.s6_addr, dst6, 18);
     ok(pdst != NULL, "The pointer should be returned (%p)\n", pdst);
 }
 
--
1.6.4.2