diff options
author | Werner Koch <wk@gnupg.org> | 2005-03-23 08:53:54 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2005-03-23 08:53:54 +0000 |
commit | b99e432c6cc468539cbd9a557c667764458fe587 (patch) | |
tree | a90f71389ee3eed2ea5a34c1bdb90a26f48fb6da | |
parent | fa04d7fca1add282b0f3385d4f127b724c885da7 (diff) | |
download | libgcrypt-b99e432c6cc468539cbd9a557c667764458fe587.tar.gz |
(_gcry_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.
-rw-r--r-- | cipher/ChangeLog | 6 | ||||
-rw-r--r-- | cipher/rndw32.c | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 5306340c..f1d91321 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,3 +1,9 @@ +2005-03-23 Werner Koch <wk@g10code.com> + + * rndw32.c (_gcry_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-19 Moritz Schulte <moritz@g10code.com> * cipher.c (do_cbc_encrypt): Be careful to not overwrite data, diff --git a/cipher/rndw32.c b/cipher/rndw32.c index 870eec66..e20f6c52 100644 --- a/cipher/rndw32.c +++ b/cipher/rndw32.c @@ -635,13 +635,14 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, int), (*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 ); } @@ -669,7 +670,7 @@ _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, int), 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 (); |