[2/2] wininet: HTTP_HttpAddRequestHeadersW should ignore 0-lengthheaders

Paul TBBle Hampson Paul.Hampson at Pobox.com
Fri Apr 24 22:38:06 CDT 2009

On Sat, Apr 25, 2009 at 11:52:20AM +0900, Dmitry Timoshkov wrote:
> "Paul TBBle Hampson" <Paul.Hampson at Pobox.com> wrote:

> >+        if (strlenW(lpszStart)==0)
> >+        {
> >+            /* Skip 0-length headers */
> >+            lpszStart = lpszEnd;
> >+            bSuccess = TRUE;
> >+            continue;
> >+        }

> Instead of 'if (strlenW(lpszStart)==0)' it's much simpler to do
> 'if (!*lpszStart)', and move the fix to HTTP_InterpretHttpHeader().

Looking at HTTP_InterpretHttpHeader, it should reject blank headers,
otherwise it cannot produce sensible non-NULL results.

But certainly changing it to !*lpszStart works. Or in fact (*lpszStart
== '\0') for consistency with the previous such testh.

I'll retest with this change, but I won't resubmit for now, in case
you're going to tell me what I've missed about HTTP_InterpretHttpHeader.

Paul "TBBle" Hampson, B.Sc, LPI, MCSE
Very-later-year Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Pobox.com

Of course Pacman didn't influence us as kids. If it did,
we'd be running around in darkened rooms, popping pills and
listening to repetitive music.
 -- Kristian Wilson, Nintendo, Inc, 1989

License: http://creativecommons.org/licenses/by/2.5/au/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20090425/6ded4d8b/attachment.pgp>

More information about the wine-devel mailing list