diff options
author | Werner Koch <[email protected]> | 2005-03-23 08:50:27 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2005-03-23 08:50:27 +0000 |
commit | 4d5285ee8744f0cbbecd22109116d517c84af345 (patch) | |
tree | ec342c8a43b7d080d753462e7cdb30dda6d4adf5 | |
parent | * gpgkeys_ldap.c, ksutil.h, ksutil.c (print_nocr): Moved from (diff) | |
download | gnupg-4d5285ee8744f0cbbecd22109116d517c84af345.tar.gz gnupg-4d5285ee8744f0cbbecd22109116d517c84af345.zip |
(rndw32_gather_random_fast): While adding data use the
size of the object and not the one of its address. Bug reported by
Sascha Kiefer.
Diffstat (limited to '')
-rw-r--r-- | cipher/ChangeLog | 8 | ||||
-rw-r--r-- | cipher/rndw32.c | 9 |
2 files changed, 12 insertions, 5 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 9965eed4b..826645c0b 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,9 @@ +2005-03-23 Werner Koch <[email protected]> + + * rndw32.c (rndw32_gather_random_fast): While adding data use the + size of the object and not the one of its address. Bug reported by + Sascha Kiefer. + 2005-03-07 Werner Koch <[email protected]> * primegen.c (is_prime): Free A2. Noted by [email protected]. @@ -1212,7 +1218,7 @@ Mon Feb 16 10:08:47 1998 Werner Koch ([email protected]) Copyright 1998, 1999, 2000, 2001, 2002, 2003, - 2004 Free Software Foundation, Inc. + 2004, 2005 Free Software Foundation, Inc. This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without diff --git a/cipher/rndw32.c b/cipher/rndw32.c index 5e42353aa..28602fd5f 100644 --- a/cipher/rndw32.c +++ b/cipher/rndw32.c @@ -654,13 +654,14 @@ rndw32_gather_random_fast( void (*add)(const void*, size_t, int), int requester (*add) ( &kernelTime, sizeof (kernelTime), requester ); (*add) ( &userTime, sizeof (userTime), requester ); - /* Get the minimum and maximum working set size for the current process */ + /* Get the minimum and maximum working set size for the + current process */ GetProcessWorkingSetSize (handle, &minimumWorkingSetSize, &maximumWorkingSetSize); (*add) ( &minimumWorkingSetSize, - sizeof (&minimumWorkingSetSize), requester ); + sizeof (minimumWorkingSetSize), requester ); (*add) ( &maximumWorkingSetSize, - sizeof (&maximumWorkingSetSize), requester ); + sizeof (maximumWorkingSetSize), requester ); } @@ -688,7 +689,7 @@ rndw32_gather_random_fast( void (*add)(const void*, size_t, int), int requester if (QueryPerformanceCounter (&performanceCount)) { if ( debug_me ) log_debug ("rndw32#gather_random_fast: perf data\n"); - (*add) (&performanceCount, sizeof (&performanceCount), requester); + (*add) (&performanceCount, sizeof (performanceCount), requester); } else { /* Millisecond accuracy at best... */ DWORD aword = GetTickCount (); |