If the structures have empty padding bytes, ensure they are zeroed.
These structures are added to seed pools as complete blocks including
any padding and alignment bytes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8610)
pid_t pid;
CRYPTO_THREAD_ID tid;
uint64_t time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add process id, thread id, and a high resolution timestamp to
struct {
CRYPTO_THREAD_ID tid;
uint64_t time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add some noise from the thread id and a high resolution timer.
pid_t pid;
CRYPTO_THREAD_ID tid;
uint64_t time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add process id, thread id, and a high resolution timestamp
struct {
CRYPTO_THREAD_ID tid;
uint64_t time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add some noise from the thread id and a high resolution timer.
DWORD pid;
DWORD tid;
FILETIME time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add process id, thread id, and a high resolution timestamp to
struct {
DWORD tid;
LARGE_INTEGER time;
- } data = { 0 };
+ } data;
+
+ /* Erase the entire structure including any padding */
+ memset(&data, 0, sizeof(data));
/*
* Add some noise from the thread id and a high resolution timer.