diff options
Diffstat (limited to 'src/lib/rng/system_rng/system_rng.cpp')
-rw-r--r-- | src/lib/rng/system_rng/system_rng.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/rng/system_rng/system_rng.cpp b/src/lib/rng/system_rng/system_rng.cpp index af508fd90..3f884115a 100644 --- a/src/lib/rng/system_rng/system_rng.cpp +++ b/src/lib/rng/system_rng/system_rng.cpp @@ -119,7 +119,11 @@ class System_RNG_Impl final : public RandomNumberGenerator void randomize(uint8_t buf[], size_t len) override { - ::arc4random_buf(buf, len); + // macOS 10.15 arc4random crashes if called with len == 0 + if(len > 0) + { + ::arc4random_buf(buf, len); + } } bool accepts_input() const override { return false; } |