summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kraft <Matthias.Kraft@softwareag.com>2016-09-30 10:50:17 +0200
committerRich Salz <rsalz@openssl.org>2016-11-12 22:22:21 -0500
commit3201a1d68121cb074c4b7e7712be77acb17df632 (patch)
tree5ece64637434167c4c558ce944fffbfc69007dfd
parent19e1de548eff0b08ba2878b3258aaceead32977b (diff)
downloadopenssl-new-3201a1d68121cb074c4b7e7712be77acb17df632.tar.gz
Solution proposal for issue #1647.
Avoid a memory alignment issue. Signed-off-by: Matthias Kraft <Matthias.Kraft@softwareag.com> CLA: trivial Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1650)
-rw-r--r--ssl/bad_dtls_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/bad_dtls_test.c b/ssl/bad_dtls_test.c
index d42817fc32..70d8578b58 100644
--- a/ssl/bad_dtls_test.c
+++ b/ssl/bad_dtls_test.c
@@ -756,6 +756,7 @@ int main(int argc, char *argv[])
BIO *rbio;
BIO *wbio;
BIO *err;
+ time_t now = 0;
int testresult = 0;
int ret;
int i;
@@ -773,7 +774,9 @@ int main(int argc, char *argv[])
RAND_bytes(master_secret, sizeof(master_secret));
RAND_bytes(cookie, sizeof(cookie));
RAND_bytes(server_random + 4, sizeof(server_random) - 4);
- time((void *)server_random);
+
+ now = time(NULL);
+ memcpy(server_random, &now, sizeof(now));
sess = client_session();
if (sess == NULL) {