Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 62942 invoked from network); 31 Jul 2010 20:03:34 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 31 Jul 2010 20:03:34 -0000 Received: (qmail 38997 invoked by uid 500); 31 Jul 2010 20:03:34 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 38942 invoked by uid 500); 31 Jul 2010 20:03:33 -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 38935 invoked by uid 99); 31 Jul 2010 20:03:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Jul 2010 20:03:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Sat, 31 Jul 2010 20:03:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5706C23888D2; Sat, 31 Jul 2010 20:02:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r981085 - /httpd/httpd/trunk/modules/http/mod_mime.c Date: Sat, 31 Jul 2010 20:02:14 -0000 To: cvs@httpd.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100731200214.5706C23888D2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sf Date: Sat Jul 31 20:02:13 2010 New Revision: 981085 URL: http://svn.apache.org/viewvc?rev=981085&view=rev Log: Replace apr_palloc+memcpy by apr_memdup Submitted by: Boya Sun PR: 39518 Modified: httpd/httpd/trunk/modules/http/mod_mime.c Modified: httpd/httpd/trunk/modules/http/mod_mime.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/mod_mime.c?rev=981085&r1=981084&r2=981085&view=diff ============================================================================== --- httpd/httpd/trunk/modules/http/mod_mime.c (original) +++ httpd/httpd/trunk/modules/http/mod_mime.c Sat Jul 31 20:02:13 2010 @@ -182,10 +182,10 @@ static void remove_items(apr_pool_t *p, APR_HASH_KEY_STRING); if (exinfo && *(const char**)((char *)exinfo + suffix[i].offset)) { extension_info *copyinfo = exinfo; - exinfo = (extension_info*)apr_palloc(p, sizeof(*exinfo)); + exinfo = apr_pmemdup(p, copyinfo, sizeof(*exinfo)); apr_hash_set(mappings, suffix[i].name, APR_HASH_KEY_STRING, exinfo); - memcpy(exinfo, copyinfo, sizeof(*exinfo)); + *(const char**)((char *)exinfo + suffix[i].offset) = NULL; } }