summaryrefslogtreecommitdiff
path: root/libc/crypt
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-09-06 15:08:18 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-09-06 15:08:18 +0000
commit098e6c37e3835dee6506593d88313502f35b0987 (patch)
treec3c2f4c56e6aa4646ddc31f3ebd3afa64435b425 /libc/crypt
parent10b7282e0adbdf46051663a61aff42b99f21e1b7 (diff)
downloadeglibc2-098e6c37e3835dee6506593d88313502f35b0987.tar.gz
Merge changes between r14661 and r15223 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15224 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/crypt')
-rw-r--r--libc/crypt/crypt_util.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/libc/crypt/crypt_util.c b/libc/crypt/crypt_util.c
index 7999a3067..04b262d9c 100644
--- a/libc/crypt/crypt_util.c
+++ b/libc/crypt/crypt_util.c
@@ -1,7 +1,8 @@
/*
* UFC-crypt: ultra fast crypt(3) implementation
*
- * Copyright (C) 1991-1993,1996-1998,2000,2010 Free Software Foundation, Inc.
+ * Copyright (C) 1991-1993,1996-1998,2000,2010,2011
+ * Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -475,7 +476,8 @@ __init_des_r(__data)
small_tables_done:
__libc_lock_unlock(_ufc_tables_lock);
#endif
- }
+ } else
+ atomic_read_barrier ();
/*
* Create the sb tables:
@@ -490,10 +492,20 @@ small_tables_done:
*
*/
- _ufc_clearmem((char*)__data->sb0, (int)sizeof(__data->sb0));
- _ufc_clearmem((char*)__data->sb1, (int)sizeof(__data->sb1));
- _ufc_clearmem((char*)__data->sb2, (int)sizeof(__data->sb2));
- _ufc_clearmem((char*)__data->sb3, (int)sizeof(__data->sb3));
+ if (__data->sb0 + sizeof (__data->sb0) == __data->sb1
+ && __data->sb1 + sizeof (__data->sb1) == __data->sb2
+ && __data->sb2 + sizeof (__data->sb2) == __data->sb3)
+ _ufc_clearmem(__data->sb0,
+ (int)sizeof(__data->sb0)
+ + (int)sizeof(__data->sb1)
+ + (int)sizeof(__data->sb2)
+ + (int)sizeof(__data->sb3));
+ else {
+ _ufc_clearmem(__data->sb0, (int)sizeof(__data->sb0));
+ _ufc_clearmem(__data->sb1, (int)sizeof(__data->sb1));
+ _ufc_clearmem(__data->sb2, (int)sizeof(__data->sb2));
+ _ufc_clearmem(__data->sb3, (int)sizeof(__data->sb3));
+ }
for(sg = 0; sg < 4; sg++) {
int j1, j2;