Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 97246 invoked from network); 13 Oct 2005 18:37:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Oct 2005 18:37:06 -0000 Received: (qmail 87027 invoked by uid 500); 13 Oct 2005 18:37:04 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 86993 invoked by uid 500); 13 Oct 2005 18:37:04 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 86982 invoked by uid 99); 13 Oct 2005 18:37:04 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 13 Oct 2005 11:37:04 -0700 Received: (qmail 97164 invoked by uid 65534); 13 Oct 2005 18:36:44 -0000 Message-ID: <20051013183644.97163.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r320868 - /httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Date: Thu, 13 Oct 2005 18:36:43 -0000 To: cvs@httpd.apache.org From: pquerna@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: pquerna Date: Thu Oct 13 11:36:42 2005 New Revision: 320868 URL: http://svn.apache.org/viewcvs?rev=320868&view=rev Log: Become more paranoid about zero length bodies, and returning NULL from other functions. This should fix at least one of the crashes being seen on Ajax. 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/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c?rev=320868&r1=320867&r2=320868&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 Thu Oct 13 11:36:42 2005 @@ -981,11 +981,18 @@ ap_set_content_type(r, mime_part->content_type); } - mime_part->body[mime_part->body_len] = 0; - ap_rprintf(r, "%s", mbox_mime_decode_body(r->pool, - mime_part->cte, - mime_part->body, - mime_part->body_len)); + if (mime_part->body_len > 0) { + const char* pdata; + /* XXXX: Not binary data safe? */ + mime_part->body[mime_part->body_len] = 0; + pdata = mbox_mime_decode_body(r->pool, + mime_part->cte, + mime_part->body, + mime_part->body_len); + if (pdata != NULL) { + ap_rputs(pdata, r); + } + } return OK; }