[Bug 17914] New: Using \n rather then \r\n breaks HTTP RFC with HTTP_AddRequestHeadersW

wine-bugs at winehq.org wine-bugs at winehq.org
Tue Mar 31 13:06:55 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=17914

           Summary: Using \n rather then \r\n breaks HTTP RFC with
                    HTTP_AddRequestHeadersW
           Product: Wine
           Version: 1.1.18
          Platform: Other
        OS/Version: other
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: wininet
        AssignedTo: wine-bugs at winehq.org
        ReportedBy: dn at devicenull.org


Half-Life 2 (and possibly other apps) uses \n characters to indicate a new line
when dealing with the InternetOpenUrl function.  Windows accepts this fine, and
ends up with the correct output.  Wine on the other hand blindly copies this
into the value as it parses the line, creating an invalid HTTP request.

The call looks like this:
trace:wininet:INTERNET_InternetOpenUrlW (0x1279fda0,
L"http://192.168.3.89/127.0.0.1/maps/de_dust3.bsp", L"Referer:
hl2://127.0.0.1:27015\n", 00000024, 84400000, 0c360e00)

the problem appears a bit later:
trace:wininet:HTTP_HttpAddRequestHeadersW copying header: L"Referer:
hl2://127.0.0.1:27015\n\0000"
trace:wininet:HTTP_HttpAddRequestHeadersW interpreting header L"Referer:
hl2://127.0.0.1:27015\n"
trace:wininet:HTTP_InterpretHttpHeader field(L"Referer")
Value(L"hl2://127.0.0.1:27015\n")

note the \n on the end of the value.  This ends up being copied into the final
HTTP request, and breaking the HTTP RFC.

The fix seems to be to just accept \n as well as \r\n sequences in 
HTTP_InterpretHttpHeader


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list