Commit a448bbf8 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Reading past end-of-file in chunked mode returns success.

Found by Andrew Eikum.
parent e8eb7813
......@@ -2761,7 +2761,7 @@ static DWORD start_next_chunk(chunked_stream_t *stream, http_request_t *req)
assert(!stream->chunk_size || stream->chunk_size == ~0u);
if (stream->end_of_data) return ERROR_NO_MORE_FILES;
if (stream->end_of_data) return ERROR_SUCCESS;
/* read terminator for the previous chunk */
if(!stream->chunk_size && (res = discard_chunked_eol(stream, req)) != ERROR_SUCCESS)
......
......@@ -734,7 +734,7 @@ static void InternetReadFile_chunked_test(void)
{
BOOL res;
CHAR buffer[4000];
DWORD length;
DWORD length, got;
const char *types[2] = { "*", NULL };
HINTERNET hi, hic = 0, hor = 0;
......@@ -814,7 +814,6 @@ static void InternetReadFile_chunked_test(void)
trace("got %u available\n",length);
if (length)
{
DWORD got;
char *buffer = HeapAlloc(GetProcessHeap(),0,length+1);
res = InternetReadFile(hor,buffer,length,&got);
......@@ -828,7 +827,13 @@ static void InternetReadFile_chunked_test(void)
if (!got) break;
}
if (length == 0)
{
got = 0xdeadbeef;
res = InternetReadFile( hor, buffer, 1, &got );
ok( res, "InternetReadFile failed: %u\n", GetLastError() );
ok( !got, "got %u\n", got );
break;
}
}
abort:
trace("aborting\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment