From e56127299dd3bb78db3838b2df516606d1911299 Mon Sep 17 00:00:00 2001 From: millert <> Date: Wed, 2 Aug 2000 04:10:47 +0000 Subject: $HOME paranoia: never use getenv("HOME") w/o checking for NULL and non-zero --- src/lib/libcrypto/rand/randfile.c | 2 +- src/lib/libssl/src/crypto/rand/randfile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c index 53a75667f4..c6ff27be0e 100644 --- a/src/lib/libcrypto/rand/randfile.c +++ b/src/lib/libcrypto/rand/randfile.c @@ -230,7 +230,7 @@ const char *RAND_file_name(char *buf, int size) else { s=getenv("HOME"); - if (s == NULL) + if (s == NULL || *s == '\0') ret = RFILE; if (((int)(strlen(s)+strlen(RFILE)+2)) > size) ret=RFILE; diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c index 53a75667f4..c6ff27be0e 100644 --- a/src/lib/libssl/src/crypto/rand/randfile.c +++ b/src/lib/libssl/src/crypto/rand/randfile.c @@ -230,7 +230,7 @@ const char *RAND_file_name(char *buf, int size) else { s=getenv("HOME"); - if (s == NULL) + if (s == NULL || *s == '\0') ret = RFILE; if (((int)(strlen(s)+strlen(RFILE)+2)) > size) ret=RFILE; -- cgit v1.2.3-55-g6feb