aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rand/randfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r--crypto/rand/randfile.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 982074c465..7c2673a61f 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -203,8 +203,9 @@ const char *RAND_file_name(char *buf, size_t size)
s=getenv("RANDFILE");
if (s != NULL)
{
- strncpy(buf,s,size-1);
- buf[size-1]='\0';
+ if(strlen(s) >= size)
+ return NULL;
+ strcpy(buf,s);
ret=buf;
}
else