On Mon, May 2, 2011 at 7:15 AM, Robert Schulze <[email protected]> wrote:
> Hi,
>
> Am 02.05.2011 16:06, schrieb Artem Belevich:
>>
>> Second problem -- res on success will always be "" as you've just did
>> *ptr=0.
>
> thats right, the copy should look like:
>
> res=strdup(str+4);
>
>> Bzzt!
>>
>> Try it on "GET blah_HTTP/1.1.1.1.1.1_whatever HTTP/1.1"
>
> will return "blah_HTTP/1.1.1.1.1.1_whatever" as resource.
> It should be the next step to check whether <resource> is valid.

Oops. Should've been space after blah, not underscore.

>        if(ptr && (ptr=strstr(ptr," HTTP/1.1"))) /* find end of res */

Contrary to the comment in the code you're not checking for "HTTP/1.1"
at the end but you're checking for it *anywhere* in the string. While
it will occur at the end of valid input string, nobody said it can't
occur in the middle, too. Original requirement was saying "surrounded
by GET and HTTP/1.1".

--Artem

>
> with kind regards,
> Robert Schulze
> _______________________________________________
> [email protected] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "[email protected]"
>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to