crypto/rand: Fix a crash bug in RAND_enable_fork_unsafe_buffering.
Change-Id: Ifff59b1518f513c1be70e4e0d4ed3430741d0a5e Reviewed-on: https://boringssl-review.googlesource.com/12860 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org>
This commit is contained in:
parent
4cc1ccd3fc
commit
36ca21415a
@ -207,12 +207,12 @@ void RAND_enable_fork_unsafe_buffering(int fd) {
|
||||
abort(); // Already initialized
|
||||
}
|
||||
|
||||
if (urandom_fd == kHaveGetrandom) {
|
||||
if (fd >= 0) {
|
||||
if (fd >= 0) {
|
||||
if (urandom_fd == kHaveGetrandom) {
|
||||
close(fd);
|
||||
} else if (urandom_fd != fd) {
|
||||
abort(); // Already initialized.
|
||||
}
|
||||
} else if (urandom_fd != fd) {
|
||||
abort(); // Already initialized.
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user