From: Jeff Trawick Date: Sat, 26 Jan 2002 23:01:31 +0000 (+0000) Subject: ap_rgetline(): completely ignore an empty bucket... previously the logic X-Git-Tag: 2.0.31~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4423c0c6deffee897240fd62b3a8d20628158dfc;p=apache ap_rgetline(): completely ignore an empty bucket... previously the logic generally worked but with a memory debug build it could crash since some memory debuggers don't like an alloc of zero bytes git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93037 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/protocol.c b/server/protocol.c index cf997d6f2b..c3c4204e77 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -245,6 +245,14 @@ AP_DECLARE(apr_status_t) ap_rgetline(char **s, apr_size_t n, return rv; } + if (len == 0) { + /* no use attempting a zero-byte alloc (hurts when + * using --with-efence --enable-pool-debug) or + * doing any of the other logic either + */ + continue; + } + /* Would this overrun our buffer? If so, we'll die. */ if (n < bytes_handled + len) { apr_brigade_destroy(b);