diff options
author | Andy Polyakov <appro@openssl.org> | 2016-09-20 17:06:58 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2016-09-21 21:10:18 +0200 |
commit | 13af417ba4f6b826833d4b1f6caa39c4e0013d6f (patch) | |
tree | b6f9f057a4d4c4cce23ddcdebd065d8d6144694f | |
parent | 098dc9be439e5bc3625e01c4092bedc072498da9 (diff) |
rand/randfile.c: rationalize __OpenBSD__ code path.
Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit ba8fa4e53a35a0c46d1e0e81a4d270a026fac2b9)
-rw-r--r-- | crypto/rand/randfile.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 16cc27aa9b..dfec2c7d6b 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -357,11 +357,7 @@ const char *RAND_file_name(char *buf, size_t size) * available. */ - if (!buf[0]) - if (OPENSSL_strlcpy(buf, "/dev/arandom", size) >= size) { - return NULL; - } - if (stat(buf, &sb) == -1) + if (!buf[0] || stat(buf, &sb) == -1) if (OPENSSL_strlcpy(buf, "/dev/arandom", size) >= size) { return NULL; } |