Commit d7357a49 authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed a couple of off-by-one errors.

parent 73bd3be8
......@@ -1551,8 +1551,8 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
}
/* allocate space for an array of all the string pointers to be added */
len = (HTTP_QUERY_MAX + lpwhr->nCustHeaders)*4 + 8;
req = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len*sizeof(LPCWSTR) );
len = (HTTP_QUERY_MAX + lpwhr->nCustHeaders)*4 + 9;
req = HeapAlloc( GetProcessHeap(), 0, len*sizeof(LPCWSTR) );
/* add the verb, path and HTTP/1.0 */
n = 0;
......@@ -1604,7 +1604,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
req[n++] = lpwhr->lpszHostName;
}
if( n > len )
if( n >= len )
ERR("oops. buffer overrun\n");
req[n] = NULL;
......
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