Commit 51393865 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't panic if the chunked header is ridiculously long, just fail

the transaction.

Fixes #387



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3500 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent cdee0548
......@@ -110,7 +110,8 @@ fetch_chunked(struct sess *sp, struct http_conn *htc)
/* If we didn't succeed, add to buffer, try again */
if (q == NULL || q == buf || *q != '\n') {
xxxassert(be > bp);
if (bp >= be)
return (-1);
/*
* The semantics we need here is "read until you have
* received at least one character, but feel free to
......
# $Id$
test "Regression test for #387: too long chunk header"
server s1 {
rxreq
send "HTTP/1.1 200 Ok\r\n"
send "Transfer-encoding: chunked\r\n"
send "\r\n"
send "004\r\n1234\r\n"
send "000000000000000000001\r\n@\r\n"
send "00000000\r\n"
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq
rxresp
expect resp.status == 503
} -run
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