[WININET]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 20 Jul 2014 08:30:21 +0000 (08:30 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 20 Jul 2014 08:30:21 +0000 (08:30 +0000)
- Apply Wine commit 8fd44a3d (wininet: Fix invalid memory access in HTTP_QUERY_RAW_HEADERS (Valgrind).) by Sebastian Lackner. Fixes crash in wininet:http InternetReadFile_test

svn path=/trunk/; revision=63724

reactos/dll/win32/wininet/http.c

index 7e7bd33..e287abd 100644 (file)
@@ -3568,12 +3568,12 @@ static DWORD HTTP_HttpQueryInfoW(http_request_t *request, DWORD dwInfoLevel,
 
                 TRACE("returning data: %s\n", debugstr_wn(headers, len / sizeof(WCHAR)));
 
-                for (i=0; i<len; i++)
+                for (i = 0; i < len / sizeof(WCHAR); i++)
                 {
                     if (headers[i] == '\n')
                         headers[i] = 0;
                 }
-                memcpy(lpBuffer, headers, len + sizeof(WCHAR));
+                memcpy(lpBuffer, headers, len);
             }
             *lpdwBufferLength = len - sizeof(WCHAR);