]> 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:09:31 +0000 (15:09 +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 ef0b74404972feb121ae5eba54196f4fb37fa820..34128616e2700e439be217f578fee628e64eb936 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.