summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc
diff options
context:
space:
mode:
authordjm <>2008-04-13 00:22:17 +0000
committerdjm <>2008-04-13 00:22:17 +0000
commit3e091e5f9bb5ae7fbc3f63db4474a599ad3fe529 (patch)
tree0e1965dcc8091ab020514725a20f44d719ea77a4 /src/regress/lib/libc
parentd1031d50623e71c1ec734e02b7cd61ec97899d9f (diff)
downloadopenbsd-3e091e5f9bb5ae7fbc3f63db4474a599ad3fe529.tar.gz
openbsd-3e091e5f9bb5ae7fbc3f63db4474a599ad3fe529.tar.bz2
openbsd-3e091e5f9bb5ae7fbc3f63db4474a599ad3fe529.zip
Use arc4random_buf() when requesting more than a single word of output
Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
Diffstat (limited to 'src/regress/lib/libc')
-rw-r--r--src/regress/lib/libc/malloc/malloc0test/malloc0test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libc/malloc/malloc0test/malloc0test.c b/src/regress/lib/libc/malloc/malloc0test/malloc0test.c
index eb00954f92..06ff0996ee 100644
--- a/src/regress/lib/libc/malloc/malloc0test/malloc0test.c
+++ b/src/regress/lib/libc/malloc/malloc0test/malloc0test.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: malloc0test.c,v 1.4 2004/08/04 12:02:57 otto Exp $ */ 1/* $OpenBSD: malloc0test.c,v 1.5 2008/04/13 00:22:17 djm Exp $ */
2/* 2/*
3 * Public domain. 2001, Theo de Raadt 3 * Public domain. 2001, Theo de Raadt
4 */ 4 */
@@ -92,7 +92,7 @@ usage:
92 limit = LONG_MAX; 92 limit = LONG_MAX;
93 93
94 for (count = 0; count < limit; count++) { 94 for (count = 0; count < limit; count++) {
95 size = arc4random() % SIZE; 95 size = arc4random_uniform(SIZE);
96 blob = malloc(size); 96 blob = malloc(size);
97 if (blob == NULL) { 97 if (blob == NULL) {
98 fprintf(stderr, "success: out of memory\n"); 98 fprintf(stderr, "success: out of memory\n");