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 2010/09/18 22:14:43 UTC

svn commit: r998533 - /apr/apr/trunk/crypto/apr_md5.c

Author: sf
Date: Sat Sep 18 20:14:42 2010
New Revision: 998533

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

Modified:
    apr/apr/trunk/crypto/apr_md5.c

Modified: apr/apr/trunk/crypto/apr_md5.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/crypto/apr_md5.c?rev=998533&r1=998532&r2=998533&view=diff
==============================================================================
--- apr/apr/trunk/crypto/apr_md5.c (original)
+++ apr/apr/trunk/crypto/apr_md5.c Sat Sep 18 20:14:42 2010
@@ -754,12 +754,15 @@ APR_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;