You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2012/07/06 13:25:21 UTC

svn commit: r1358133 - in /apr/apr-util/branches/1.5.x: ./ crypto/apr_md5.c

Author: sf
Date: Fri Jul  6 11:25:21 2012
New Revision: 1358133

URL: http://svn.apache.org/viewvc?rev=1358133&view=rev
Log:
Merge r998533 from apr trunk:
    No need to clear 128k of memory because of bugs that have been fixed
    8 years ago.

Modified:
    apr/apr-util/branches/1.5.x/   (props changed)
    apr/apr-util/branches/1.5.x/crypto/apr_md5.c

Propchange: apr/apr-util/branches/1.5.x/
------------------------------------------------------------------------------
  Merged /apr/apr/trunk:r998533

Modified: apr/apr-util/branches/1.5.x/crypto/apr_md5.c
URL: http://svn.apache.org/viewvc/apr/apr-util/branches/1.5.x/crypto/apr_md5.c?rev=1358133&r1=1358132&r2=1358133&view=diff
==============================================================================
--- apr/apr-util/branches/1.5.x/crypto/apr_md5.c (original)
+++ apr/apr-util/branches/1.5.x/crypto/apr_md5.c Fri Jul  6 11:25:21 2012
@@ -728,12 +728,15 @@ APU_DECLARE(apr_status_t) apr_password_v
 #elif defined(CRYPT_R_STRUCT_CRYPT_DATA)
         struct crypt_data buffer;
 
-        /* having to clear this seems bogus... GNU doc is
-         * confusing...  user report found from google says
-         * the crypt_data struct had to be cleared to get
-         * the same result as plain crypt()
+#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2,4)
+        buffer.initialized = 0;
+#else
+        /*
+         * glibc before 2.3.2 had a bug that required clearing the
+         * whole struct
          */
         memset(&buffer, 0, sizeof(buffer));
+#endif
         crypt_pw = crypt_r(passwd, hash, &buffer);
         if (!crypt_pw) {
             return APR_EMISMATCH;