Fix segfault when failing to read random numbers.
authorGuus Sliepen <guus@tinc-vpn.org>
Mon, 21 Sep 2020 21:22:18 +0000 (23:22 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 21 Sep 2020 21:22:18 +0000 (23:22 +0200)
commit3ee0d5dddb56a13b8f3c50637e3cd075c701c9aa
tree4c641ffa54673b9078d011c46276668285e17b12
parentd0ae7fa0162cf5b70dca1b34b42f49e94bf93a48
Fix segfault when failing to read random numbers.

Because the result of read() was incorrectly stored in an unsigned
variable, an error reading from the random number generator device would
result in an infinite loop that would start writing out of bounds and
eventually corrupt the stack.
src/nolegacy/crypto.c
src/openssl/crypto.c