From 10c37f199e6be7bdb5cbd8a58cbe30279d2d4d45 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Mon, 14 Nov 2005 14:49:45 +0000 Subject: [PATCH] - fix endless loop with bad input --- http_filter_api.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/http_filter_api.c b/http_filter_api.c index 53877e2..421c07f 100644 --- a/http_filter_api.c +++ b/http_filter_api.c @@ -114,7 +114,7 @@ static HTTP_FILTER_FUNCTION(chunked_decode) /* we have data in our buffer */ while (PHPSTR_LEN(buffer)) { - + fprintf(stderr, ">>> loop\n"); /* we already know the size of the chunk and are waiting for data */ if (buffer->hexlen) { @@ -191,6 +191,9 @@ static HTTP_FILTER_FUNCTION(chunked_decode) phpstr_cut(PHPSTR(buffer), 0, eolstr + eollen - PHPSTR_VAL(buffer)); /* buffer->hexlen is 0 now or contains the size of the next chunk */ /* continue */ + } else { + /* we have not enough data buffered to read in chunk size */ + break; } } /* break */ -- 2.30.2