2 Sep 2004 00:06
Re: problems with fcgi
Jan Kneschke <jan <at> kneschke.de>
2004-09-01 22:06:15 GMT
2004-09-01 22:06:15 GMT
On Sun, Aug 29, 2004 at 07:40:02PM -0500, Mike wrote:
> fcgi.c:1145
> buffer_append_string(hctx->response_header, hctx->response->ptr);
> this code makes it trivial for a bad fcgi to core lighttpd. If there
> is no \r\n\r\n in the resopnse, this case gets called instead. The
> response buffer is not null terminated, and at best buffer_append_string
> will get random data into the buffer after calling strlen() on it. The
> more likely scenario is a core when strlen() hits top of heap.
Just checked the code. The terminator was removed by a #ifdef. Changing
buffer_append_string(hctx->response_header, hctx->response->ptr);
to
buffer_append_string_buffer(hctx->response_header, hctx->response);
fixes the problem.
> Mike
>
Jan
--
--
Jan Kneschke http://jan.kneschke.de/
Perhaps you want to say 'thank you, jan': http://jk.123.org/wishlist/
RSS Feed