| ... | @@ -150,6 +150,9 @@ fn setupPthreadAtforkAndFill(buffer: []u8) void { | ... | @@ -150,6 +150,9 @@ fn setupPthreadAtforkAndFill(buffer: []u8) void { |
| 150 | } | 150 | } |
| 151 | | 151 | |
| 152 | fn childAtForkHandler() callconv(.C) void { | 152 | fn childAtForkHandler() callconv(.C) void { |
| | 153 | // The atfork handler is global, this function may be called after |
| | 154 | // fork()-ing threads that never initialized the CSPRNG context. |
| | 155 | if (wipe_mem.len == 0) return; |
| 153 | std.crypto.utils.secureZero(u8, wipe_mem); | 156 | std.crypto.utils.secureZero(u8, wipe_mem); |
| 154 | } | 157 | } |
| 155 | | 158 | |