apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mladen Turk <mt...@apache.org>
Subject [PATCH] fix apr_random
Date Sat, 28 Aug 2004 14:43:55 GMT
Hi,

This patch fixes the testrandom on WIN32.
Found by try-error-fix, knowing that
the allocated data on WIN32 is garbage, and
on unixes it might be zeroed, and that could
be the only cause why the test is passing on
my FreeBDS, but fails on WIN32.

Anyhow, all the tests passing now on WIN32,
except those with EINVAL.

Index: apr_random.c
===================================================================
RCS file: /home/cvspublic/apr/random/unix/apr_random.c,v
retrieving revision 1.9
diff -u -r1.9 apr_random.c
--- apr_random.c	28 Feb 2004 18:31:41 -0000	1.9
+++ apr_random.c	28 Aug 2004 14:35:06 -0000
@@ -111,8 +111,8 @@
                      /2)*g->pool_hash->size*2;
      g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE;

-    g->H = apr_palloc(p,H_size(g));
-    g->H_waiting = apr_palloc(p,H_size(g));
+    g->H = apr_pcalloc(p,H_size(g));
+    g->H_waiting = apr_pcalloc(p,H_size(g));

      g->randomness = apr_palloc(p,B_size(g));
      g->random_bytes = 0;


Regards,
MT.

Mime
View raw message