From de0a3d59b53fd9deced3be9a3b005741e60f8b53 Mon Sep 17 00:00:00 2001 From: sf Date: Fri, 6 Jul 2012 11:25:21 +0000 Subject: 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 --- crypto/apr_md5.c | 11 +++++++---- 1 file 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; -- cgit v1.2.1