wininet/tests: Fix off-by-one errors in HTTP tests (Coverity).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alex Henrie 2018-01-06 21:53:58 -07:00 committed by Alexandre Julliard
parent 3675b7035e
commit 7b2ead8da0
1 changed files with 2 additions and 2 deletions

View File

@ -720,7 +720,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test)
res = InternetQueryOptionA(hor,INTERNET_OPTION_URL,buffer,&length);
ok(res, "InternetQueryOptionA(INTERNET_OPTION_URL) failed with error %d\n", GetLastError());
length = sizeof(buffer)-1;
length = sizeof(buffer)-2;
memset(buffer, 0x77, sizeof(buffer));
res = HttpQueryInfoA(hor,HTTP_QUERY_RAW_HEADERS,buffer,&length,0x0);
ok(res, "HttpQueryInfoA(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError());
@ -744,7 +744,7 @@ static void InternetReadFile_test(int flags, const test_data_t *test)
ok(buffer[length2+1] == 0x77, "Expected 0x77, got %02X\n", buffer[length2+1]);
ok(length2 == length, "Value should not have changed: %d != %d\n", length2, length);
length = sizeof(wbuffer)-sizeof(WCHAR);
length = sizeof(wbuffer)-2*sizeof(WCHAR);
memset(wbuffer, 0x77, sizeof(wbuffer));
res = HttpQueryInfoW(hor, HTTP_QUERY_RAW_HEADERS, wbuffer, &length, 0x0);
ok(res, "HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError());