From: Matthias Kraft Date: Fri, 30 Sep 2016 08:50:17 +0000 (+0200) Subject: Solution proposal for issue #1647. X-Git-Tag: OpenSSL_1_0_2k~41 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3201a1d68121cb074c4b7e7712be77acb17df632;p=oweals%2Fopenssl.git Solution proposal for issue #1647. Avoid a memory alignment issue. Signed-off-by: Matthias Kraft CLA: trivial Reviewed-by: Andy Polyakov Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1650) --- 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) {