You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2011/10/25 00:02:39 UTC

svn commit: r1188408 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c

Author: sf
Date: Mon Oct 24 22:02:38 2011
New Revision: 1188408

URL: http://svn.apache.org/viewvc?rev=1188408&view=rev
Log:
Prevent out of array boundary access and segfault.

r1187591 removed a bogus check that prevented this access in most cases,
except if there were exactly as many mbox files in a directory as allocated
entries in the array.

Modified:
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c?rev=1188408&r1=1188407&r2=1188408&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Mon Oct 24 22:02:38 2011
@@ -354,7 +354,8 @@ apr_status_t mbox_static_index_boxlist(r
         }
 
         /* Year separation */
-        if (year_hdr && (fi[i].filename[3] != fi[i + 1].filename[3])) {
+        if (i + 1 < files->nelts && year_hdr
+            && (fi[i].filename[3] != fi[i + 1].filename[3])) {
             ap_rputs("    </tbody>\n", r);
             ap_rputs("   </table>\n", r);
             if (side) {