]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Windows: use srand() instead of srandom()
authorTomas Mraz <tomas@openssl.org>
Wed, 11 Oct 2023 09:20:02 +0000 (11:20 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 13 Oct 2023 13:04:42 +0000 (15:04 +0200)
This is used for memory allocation failure debugging only

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22347)

crypto/mem.c

index d7aa3ab85d8a8d631d4a8c7085a6594e8bbbc3a4..eef1165708c24357e63880dc14a055a0a3ea48f4 100644 (file)
@@ -122,12 +122,13 @@ static void parseit(void)
 }
 
 /*
- * Windows doesn't have random(), but it has rand()
+ * Windows doesn't have random() and srandom(), but it has rand() and srand().
  * Some rand() implementations aren't good, but we're not
  * dealing with secure randomness here.
  */
 # ifdef _WIN32
 #  define random() rand()
+#  define srandom(seed) srand(seed)
 # endif
 /*
  * See if the current malloc should fail.