]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/rand/rand_unix.c
Clear seed source structures.
[thirdparty/openssl.git] / crypto / rand / rand_unix.c
index 39c4e7e7417a627640cdc0fae68cd682d5de6541..5d1e0d8b17187019612ca3c927321363a89a9ea4 100644 (file)
@@ -615,7 +615,10 @@ int rand_pool_add_nonce_data(RAND_POOL *pool)
         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
@@ -634,7 +637,10 @@ int rand_pool_add_additional_data(RAND_POOL *pool)
     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.