summaryrefslogtreecommitdiff
path: root/lib/libcrypto/rand/randfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/rand/randfile.c')
-rw-r--r--lib/libcrypto/rand/randfile.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libcrypto/rand/randfile.c b/lib/libcrypto/rand/randfile.c
index f4376cf8cc5..2ffb84c89e2 100644
--- a/lib/libcrypto/rand/randfile.c
+++ b/lib/libcrypto/rand/randfile.c
@@ -233,6 +233,12 @@ const char *RAND_file_name(char *buf, size_t size)
{
if (issetugid() == 0)
s=getenv("HOME");
+#ifdef DEFAULT_HOME
+ if (s == NULL)
+ {
+ s = DEFAULT_HOME;
+ }
+#endif
if (s && *s && strlen(s)+strlen(RFILE)+2 < size)
{
strlcpy(buf,s,size);
@@ -242,7 +248,7 @@ const char *RAND_file_name(char *buf, size_t size)
strlcat(buf,RFILE,size);
ret=buf;
}
- else
+ else
buf[0] = '\0'; /* no file name */
}