Hans Leidekker : winhttp/tests: Avoid an invalid write in asynchronous mode (Valgrind).

Alexandre Julliard julliard at winehq.org
Fri Nov 9 14:12:17 CST 2018


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Fri Nov  9 14:55:00 2018 +0100

winhttp/tests: Avoid an invalid write in asynchronous mode (Valgrind).

Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winhttp/tests/notification.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c
index 086f2e7..510d9e7 100644
--- a/dlls/winhttp/tests/notification.c
+++ b/dlls/winhttp/tests/notification.c
@@ -920,7 +920,7 @@ static const struct notification read_allow_close_test[] =
 static void _read_request_data(struct test_request *req, struct info *info, const char *expected_data, BOOL closing_connection, unsigned line)
 {
     char buffer[1024];
-    DWORD read, len;
+    DWORD len;
     BOOL ret;
 
     if (closing_connection)
@@ -937,8 +937,7 @@ static void _read_request_data(struct test_request *req, struct info *info, cons
 
     setup_test( info, winhttp_read_data, line );
     memset(buffer, '?', sizeof(buffer));
-    read = 0xdeadbeef;
-    ret = WinHttpReadData( req->request, buffer, sizeof(buffer), &read );
+    ret = WinHttpReadData( req->request, buffer, sizeof(buffer), NULL );
     ok(ret, "failed to read data %u\n", GetLastError());
 
     WaitForSingleObject( info->wait, INFINITE );




More information about the wine-cvs mailing list