From 70ad98cc6f78ed7786800a5156966502a7d45739 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 3 Aug 2020 21:49:49 -0500 Subject: [PATCH] Fix arc4random_buf implementation. --- src/core/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/util.c b/src/core/util.c index d1e4f5b5..38c6cee0 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -677,9 +677,9 @@ int janet_cryptorand(uint8_t *out, size_t n) { RETRY_EINTR(rc, close(randfd)); return 0; #elif defined(JANET_BSD) || defined(MAC_OS_X_VERSION_10_7) - arc4random_buf(out, sz); + arc4random_buf(out, n); return 0; #else return -1; #endif -} \ No newline at end of file +}