wininet: Rearrange invalid header checks.
This commit is contained in:
parent
5caf809426
commit
59a217847c
|
@ -4235,13 +4235,11 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
|
||||||
TRACE("got line %s, now interpreting\n", debugstr_a(bufferA));
|
TRACE("got line %s, now interpreting\n", debugstr_a(bufferA));
|
||||||
|
|
||||||
if (!bufferA[0]) break;
|
if (!bufferA[0]) break;
|
||||||
if (!strchr(bufferA, ':'))
|
|
||||||
{
|
|
||||||
WARN("invalid header\n");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
|
MultiByteToWideChar( CP_ACP, 0, bufferA, buflen, buffer, MAX_REPLY_LEN );
|
||||||
|
|
||||||
|
pFieldAndValue = HTTP_InterpretHttpHeader(buffer);
|
||||||
|
if (pFieldAndValue)
|
||||||
|
{
|
||||||
while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders)
|
while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders)
|
||||||
cchMaxRawHeaders *= 2;
|
cchMaxRawHeaders *= 2;
|
||||||
temp = HeapReAlloc(GetProcessHeap(), 0, lpszRawHeaders, (cchMaxRawHeaders+1)*sizeof(WCHAR));
|
temp = HeapReAlloc(GetProcessHeap(), 0, lpszRawHeaders, (cchMaxRawHeaders+1)*sizeof(WCHAR));
|
||||||
|
@ -4253,15 +4251,12 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
|
||||||
cchRawHeaders += sizeof(szCrLf)/sizeof(szCrLf[0])-1;
|
cchRawHeaders += sizeof(szCrLf)/sizeof(szCrLf[0])-1;
|
||||||
lpszRawHeaders[cchRawHeaders] = '\0';
|
lpszRawHeaders[cchRawHeaders] = '\0';
|
||||||
|
|
||||||
pFieldAndValue = HTTP_InterpretHttpHeader(buffer);
|
|
||||||
if (!pFieldAndValue)
|
|
||||||
break;
|
|
||||||
|
|
||||||
HTTP_ProcessHeader(lpwhr, pFieldAndValue[0], pFieldAndValue[1],
|
HTTP_ProcessHeader(lpwhr, pFieldAndValue[0], pFieldAndValue[1],
|
||||||
HTTP_ADDREQ_FLAG_ADD );
|
HTTP_ADDREQ_FLAG_ADD );
|
||||||
|
|
||||||
HTTP_FreeTokens(pFieldAndValue);
|
HTTP_FreeTokens(pFieldAndValue);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cbreaks++;
|
cbreaks++;
|
||||||
|
|
Loading…
Reference in New Issue