From 13af417ba4f6b826833d4b1f6caa39c4e0013d6f Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 20 Sep 2016 17:06:58 +0200 Subject: [PATCH] rand/randfile.c: rationalize __OpenBSD__ code path. Reviewed-by: Rich Salz (cherry picked from commit ba8fa4e53a35a0c46d1e0e81a4d270a026fac2b9) --- crypto/rand/randfile.c | 6 +----- 1 file changed, 1 insertion(+), 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; } -- 2.25.1