diff options
| author | LemonBoy <thatlemon@gmail.com> | 2021-05-20 14:43:04 +0200 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2021-05-20 14:43:04 +0200 |
| commit | 992c02ab95e8297a1558bcf011f15a5cf1cd8e1b (patch) | |
| tree | 09887b8a4e4b39f8acd85bf0c4849b5413bb34ea /lib/std | |
| parent | 9910bfa6d887cd28dba3ac99ac0f0acf8d6e5056 (diff) | |
| download | zig-992c02ab95e8297a1558bcf011f15a5cf1cd8e1b.tar.gz zig-992c02ab95e8297a1558bcf011f15a5cf1cd8e1b.zip | |
std: Fix error in tlcsprng init sequence
The fallback case was actually switched with the success one.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/crypto/tlcsprng.zig | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/std/crypto/tlcsprng.zig b/lib/std/crypto/tlcsprng.zig index 8a2c24916b..1e39b125f6 100644 --- a/lib/std/crypto/tlcsprng.zig +++ b/lib/std/crypto/tlcsprng.zig @@ -107,13 +107,9 @@ fn tlsCsprngFill(_: *const std.rand.Random, buffer: []u8) void { break :wof; } else |_| {} - os.madvise( - wipe_mem.ptr, - wipe_mem.len, - os.MADV_WIPEONFORK, - ) catch { + if (os.madvise(wipe_mem.ptr, wipe_mem.len, os.MADV_WIPEONFORK)) |_| { return initAndFill(buffer); - }; + } else |_| {} } if (std.Thread.use_pthreads) { |
