summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsf <sf@13f79535-47bb-0310-9956-ffa450edef68>2012-07-06 11:25:21 +0000
committersf <sf@13f79535-47bb-0310-9956-ffa450edef68>2012-07-06 11:25:21 +0000
commitde0a3d59b53fd9deced3be9a3b005741e60f8b53 (patch)
tree57155b532eb961acc61f12771d60c5b1c9cdeb1c
parentdbdf97f8970c944afdd87e8ebcf2deb0eb854502 (diff)
downloadlibapr-util-de0a3d59b53fd9deced3be9a3b005741e60f8b53.tar.gz
Merge r998533 from apr trunk:
No need to clear 128k of memory because of bugs that have been fixed 8 years ago. git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/branches/1.5.x@1358133 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--crypto/apr_md5.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/apr_md5.c b/crypto/apr_md5.c
index 0894e3ec..b2c37789 100644
--- a/crypto/apr_md5.c
+++ b/crypto/apr_md5.c
@@ -728,12 +728,15 @@ APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
#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;