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 EA4259F78 for ; Fri, 28 Dec 2012 09:41:44 +0000 (UTC) Received: (qmail 10048 invoked by uid 500); 28 Dec 2012 09:41:44 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 9999 invoked by uid 500); 28 Dec 2012 09:41:44 -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 9991 invoked by uid 99); 28 Dec 2012 09:41:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 Dec 2012 09:41:44 +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, 28 Dec 2012 09:41:43 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D6E3B23889B3; Fri, 28 Dec 2012 09:41:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1426445 - in /apr/apr-util/branches/1.5.x: ./ crypto/apr_passwd.c Date: Fri, 28 Dec 2012 09:41:23 -0000 To: commits@apr.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121228094123.D6E3B23889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sf Date: Fri Dec 28 09:41:23 2012 New Revision: 1426445 URL: http://svn.apache.org/viewvc?rev=1426445&view=rev Log: Merge r1426442 from apr trunk: Fixup r1422413 so that memset is used on non-glibc platforms Noticed by Alan Hourihane Modified: apr/apr-util/branches/1.5.x/ (props changed) apr/apr-util/branches/1.5.x/crypto/apr_passwd.c Propchange: apr/apr-util/branches/1.5.x/ ------------------------------------------------------------------------------ Merged /apr/apr/trunk:r1426442 Modified: apr/apr-util/branches/1.5.x/crypto/apr_passwd.c URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_passwd.c?rev=1426445&r1=1426444&r2=1426445&view=diff ============================================================================== --- apr/apr-util/branches/1.5.x/crypto/apr_passwd.c (original) +++ apr/apr-util/branches/1.5.x/crypto/apr_passwd.c Fri Dec 28 09:41:23 2012 @@ -112,16 +112,21 @@ APU_DECLARE(apr_status_t) apr_password_v struct crypt_data buffer; #ifdef __GLIBC_PREREQ + /* + * For not too old glibc (>= 2.3.2), it's enough to set + * buffer.initialized = 0. For < 2.3.2 and for other platforms, + * we need to zero the whole struct. + */ #if __GLIBC_PREREQ(2,4) +#define USE_CRYPT_DATA_INITALIZED +#endif +#endif + +#ifdef USE_CRYPT_DATA_INITALIZED buffer.initialized = 0; #else - /* - * glibc before 2.3.2 had a bug that required clearing the - * whole struct - */ memset(&buffer, 0, sizeof(buffer)); #endif -#endif /* defined __GLIBC_PREREQ */ crypt_pw = crypt_r(passwd, hash, &buffer); if (!crypt_pw) {