diff --git a/test/bad_dtls_test.c b/test/bad_dtls_test.c index 4ee155fcdf..1408a1354e 100644 --- a/test/bad_dtls_test.c +++ b/test/bad_dtls_test.c @@ -451,6 +451,7 @@ int main(int argc, char *argv[]) BIO *rbio; BIO *wbio; BIO *err; + time_t now = 0; int testresult = 0; int ret; int i; @@ -464,7 +465,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) {