]> 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:08:11 +0000 (15:08 +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)

(cherry picked from commit 3b107b86ca7d1c6309bc7071ead59acb8c098f3b)

crypto/mem.c

index 76779a461f1a58790a7c3f5ea15d4315c7c6369c..cc19856771f9ebc51d98929ad22379ea36c01e70 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.