httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r610061 - /httpd/httpd/trunk/modules/http/http_filters.c
Date Tue, 08 Jan 2008 16:38:15 GMT
Author: rpluem
Date: Tue Jan  8 08:38:14 2008
New Revision: 610061

URL: http://svn.apache.org/viewvc?rev=610061&view=rev
Log:
* Address two edge cases:
  1. The brigade contains only META buckets.
  2. The last data bucket is of zero length.

Pointed out by: niq

Modified:
    httpd/httpd/trunk/modules/http/http_filters.c

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=610061&r1=610060&r2=610061&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Tue Jan  8 08:38:14 2008
@@ -139,11 +139,15 @@
             break;
         }
     }
+    /* We only had META buckets in this brigade */
+    if (e == APR_BRIGADE_SENTINEL(b)) {
+        return APR_EAGAIN;
+    }
     rv = apr_bucket_read(e, &lineend, &len, APR_BLOCK_READ);
     if (rv != APR_SUCCESS) {
         return rv;
     }
-    if (lineend[len - 1] != APR_ASCII_LF) {
+    if ((len == 0) || (lineend[len - 1] != APR_ASCII_LF)) {
         return APR_EAGAIN;
     }
     /* Line is complete. So reset ctx->linesize for next round. */



Mime
View raw message