From: Michael Wallner Date: Mon, 14 Nov 2005 14:49:45 +0000 (+0000) Subject: - fix endless loop with bad input X-Git-Tag: RELEASE_0_18_0~8 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=10c37f199e6be7bdb5cbd8a58cbe30279d2d4d45;p=m6w6%2Fext-http - fix endless loop with bad input --- 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 */