summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/rand/randfile.c2
-rw-r--r--src/lib/libssl/src/crypto/rand/randfile.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/rand/randfile.c b/src/lib/libcrypto/rand/randfile.c
index 8e993360fa..663a36cb70 100644
--- a/src/lib/libcrypto/rand/randfile.c
+++ b/src/lib/libcrypto/rand/randfile.c
@@ -221,7 +221,7 @@ const char *RAND_file_name(char *buf, int size)
221 221
222 if (issetugid() == 0) 222 if (issetugid() == 0)
223 s = getenv("RANDFILE"); 223 s = getenv("RANDFILE");
224 if (s != NULL && *s && strlen(s) < size) 224 if (s != NULL && *s && strlen(s) + 1 < size)
225 { 225 {
226 strlcpy(buf,s,size); 226 strlcpy(buf,s,size);
227 ret=buf; 227 ret=buf;
diff --git a/src/lib/libssl/src/crypto/rand/randfile.c b/src/lib/libssl/src/crypto/rand/randfile.c
index 8e993360fa..663a36cb70 100644
--- a/src/lib/libssl/src/crypto/rand/randfile.c
+++ b/src/lib/libssl/src/crypto/rand/randfile.c
@@ -221,7 +221,7 @@ const char *RAND_file_name(char *buf, int size)
221 221
222 if (issetugid() == 0) 222 if (issetugid() == 0)
223 s = getenv("RANDFILE"); 223 s = getenv("RANDFILE");
224 if (s != NULL && *s && strlen(s) < size) 224 if (s != NULL && *s && strlen(s) + 1 < size)
225 { 225 {
226 strlcpy(buf,s,size); 226 strlcpy(buf,s,size);
227 ret=buf; 227 ret=buf;