Return-Path: X-Original-To: apmail-apr-commits-archive@www.apache.org Delivered-To: apmail-apr-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9A27A1027D for ; Wed, 16 Jul 2014 17:38:25 +0000 (UTC) Received: (qmail 86633 invoked by uid 500); 16 Jul 2014 17:38:25 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 86581 invoked by uid 500); 16 Jul 2014 17:38:25 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 86572 invoked by uid 99); 16 Jul 2014 17:38:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2014 17:38:25 +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; Wed, 16 Jul 2014 17:38:24 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 43A63238890D; Wed, 16 Jul 2014 17:38:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1611107 - /apr/apr/trunk/tables/apr_skiplist.c Date: Wed, 16 Jul 2014 17:38:04 -0000 To: commits@apr.apache.org From: ylavic@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140716173804.43A63238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ylavic Date: Wed Jul 16 17:38:03 2014 New Revision: 1611107 URL: http://svn.apache.org/r1611107 Log: We do not garantee zero-ed memory for apr_skiplist_alloc(), neither in the description, nor in the code for reused chunks. So always allocate raw memory and don't rely on zero-ed one after internal calls to apr_skiplist_alloc(). Modified: apr/apr/trunk/tables/apr_skiplist.c Modified: apr/apr/trunk/tables/apr_skiplist.c URL: http://svn.apache.org/viewvc/apr/apr/trunk/tables/apr_skiplist.c?rev=1611107&r1=1611106&r2=1611107&view=diff ============================================================================== --- apr/apr/trunk/tables/apr_skiplist.c (original) +++ apr/apr/trunk/tables/apr_skiplist.c Wed Jul 16 17:38:03 2014 @@ -52,10 +52,6 @@ struct apr_skiplistnode { apr_skiplist *sl; }; -#ifndef MIN -#define MIN(a,b) ((apool, size); + ptr = apr_palloc(sl->pool, size); if (!ptr) { return ptr; } @@ -122,7 +118,7 @@ APR_DECLARE(void *) apr_skiplist_alloc(a return ptr; } else { - return calloc(1, size); + return malloc(size); } } @@ -348,15 +344,13 @@ static apr_skiplistnode *insert_compare( sl->height = 1; sl->topend = sl->bottomend = sl->top = sl->bottom = (apr_skiplistnode *)apr_skiplist_alloc(sl, sizeof(apr_skiplistnode)); -#if 0 - sl->top->next = (apr_skiplistnode *)NULL; - sl->top->data = (apr_skiplistnode *)NULL; - sl->top->prev = (apr_skiplistnode *)NULL; - sl->top->up = (apr_skiplistnode *)NULL; - sl->top->down = (apr_skiplistnode *)NULL; - sl->top->nextindex = (apr_skiplistnode *)NULL; - sl->top->previndex = (apr_skiplistnode *)NULL; -#endif + sl->top->next = NULL; + sl->top->data = NULL; + sl->top->prev = NULL; + sl->top->up = NULL; + sl->top->down = NULL; + sl->top->nextindex = NULL; + sl->top->previndex = NULL; sl->top->sl = sl; } if (sl->preheight) {