Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20A719F7A for ; Fri, 21 Oct 2011 23:23:11 +0000 (UTC) Received: (qmail 2582 invoked by uid 500); 21 Oct 2011 23:23:11 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 2517 invoked by uid 500); 21 Oct 2011 23:23:10 -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 2510 invoked by uid 99); 21 Oct 2011 23:23:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2011 23:23:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Oct 2011 23:23:08 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7248B238897D; Fri, 21 Oct 2011 23:22:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1187591 - in /httpd/mod_mbox/trunk/module-2.0: mbox_parse.c mbox_sort.c mod_mbox_out.c Date: Fri, 21 Oct 2011 23:22:47 -0000 To: cvs@httpd.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111021232247.7248B238897D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sf Date: Fri Oct 21 23:22:46 2011 New Revision: 1187591 URL: http://svn.apache.org/viewvc?rev=1187591&view=rev Log: mbox_parse.c, mbox_sort.c: fix potential NULL pointer dereferences found by clang mod_mbox_out.c: remove redundant NULL checks that lead to clang false-positives Modified: httpd/mod_mbox/trunk/module-2.0/mbox_parse.c httpd/mod_mbox/trunk/module-2.0/mbox_sort.c httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Modified: httpd/mod_mbox/trunk/module-2.0/mbox_parse.c URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mbox_parse.c?rev=1187591&r1=1187590&r2=1187591&view=diff ============================================================================== --- httpd/mod_mbox/trunk/module-2.0/mbox_parse.c (original) +++ httpd/mod_mbox/trunk/module-2.0/mbox_parse.c Fri Oct 21 23:22:46 2011 @@ -581,8 +581,10 @@ static apr_status_t fetch_msgc(apr_pool_ xlen = sstrlen(source); \ memcpy(dest+pos, &xlen, sizeof(xlen)); \ pos += sizeof(xlen); \ - memcpy(dest+pos, source, xlen); \ - pos += xlen; \ + if (source) { \ + memcpy(dest+pos, source, xlen); \ + pos += xlen; \ + } \ } while (0); static apr_status_t store_msgc(apr_pool_t *pool, apr_dbm_t *database, Modified: httpd/mod_mbox/trunk/module-2.0/mbox_sort.c URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mbox_sort.c?rev=1187591&r1=1187590&r2=1187591&view=diff ============================================================================== --- httpd/mod_mbox/trunk/module-2.0/mbox_sort.c (original) +++ httpd/mod_mbox/trunk/module-2.0/mbox_sort.c Fri Oct 21 23:22:46 2011 @@ -56,7 +56,7 @@ void *mbox_sort_linked_list(void *p, uns /* Distribute the records alternately to tape[0] and tape[1]. */ tape[0].count = tape[1].count = 0L; - tape[0].first = NULL; + tape[0].first = tape[1].first = NULL; base = 0; while (p != NULL) { struct record *next = ((struct record *) p)->next[index]; 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=1187591&r1=1187590&r2=1187591&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 Fri Oct 21 23:22:46 2011 @@ -354,8 +354,7 @@ apr_status_t mbox_static_index_boxlist(r } /* Year separation */ - if ((fi[i + 1].filename && year_hdr) && - (fi[i].filename[3] != fi[i + 1].filename[3])) { + if (year_hdr && (fi[i].filename[3] != fi[i + 1].filename[3])) { ap_rputs(" \n", r); ap_rputs(" \n", r); if (side) { @@ -991,7 +990,7 @@ int mbox_raw_message(request_rec *r, apr } /* Empty MIME part : we want only mail's body */ - if (part && !*part) { + if (!*part) { apr_size_t len = m->body_end - m->body_start; ap_set_content_type(r, "text/plain");