diff options
Diffstat (limited to 'src/lib/libcrypto/rand/randfile.c')
-rw-r--r-- | src/lib/libcrypto/rand/randfile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index f4376cf8cc..2ffb84c89e 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c | |||
@@ -233,6 +233,12 @@ const char *RAND_file_name(char *buf, size_t size) | |||
233 | { | 233 | { |
234 | if (issetugid() == 0) | 234 | if (issetugid() == 0) |
235 | s=getenv("HOME"); | 235 | s=getenv("HOME"); |
236 | #ifdef DEFAULT_HOME | ||
237 | if (s == NULL) | ||
238 | { | ||
239 | s = DEFAULT_HOME; | ||
240 | } | ||
241 | #endif | ||
236 | if (s && *s && strlen(s)+strlen(RFILE)+2 < size) | 242 | if (s && *s && strlen(s)+strlen(RFILE)+2 < size) |
237 | { | 243 | { |
238 | strlcpy(buf,s,size); | 244 | strlcpy(buf,s,size); |
@@ -242,7 +248,7 @@ const char *RAND_file_name(char *buf, size_t size) | |||
242 | strlcat(buf,RFILE,size); | 248 | strlcat(buf,RFILE,size); |
243 | ret=buf; | 249 | ret=buf; |
244 | } | 250 | } |
245 | else | 251 | else |
246 | buf[0] = '\0'; /* no file name */ | 252 | buf[0] = '\0'; /* no file name */ |
247 | } | 253 | } |
248 | 254 | ||