apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1426445 - in /apr/apr-util/branches/1.5.x: ./ crypto/apr_passwd.c
Date Fri, 28 Dec 2012 09:41:23 GMT
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 <alanh fairlite co uk>

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) {



Mime
View raw message