]> granicus.if.org Git - apache/commitdiff
ap_rgetline(): completely ignore an empty bucket... previously the logic
authorJeff Trawick <trawick@apache.org>
Sat, 26 Jan 2002 23:01:31 +0000 (23:01 +0000)
committerJeff Trawick <trawick@apache.org>
Sat, 26 Jan 2002 23:01:31 +0000 (23:01 +0000)
               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

server/protocol.c

index cf997d6f2bf40a7f125b03a93a90a27d202a45a9..c3c4204e7757326fbd6d3a4ffea1fa48e78798b1 100644 (file)
@@ -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);