summaryrefslogtreecommitdiff
path: root/security/openssl/patches/patch-ag
blob: 014f0b494e71d7a8c93dbd349b565e78318937c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-ag,v 1.6 2002/08/10 04:50:33 fredb Exp $

--- crypto/rand/randfile.c.orig	Fri Aug  9 22:31:54 2002
+++ crypto/rand/randfile.c
@@ -225,9 +225,10 @@
 
 	if (OPENSSL_issetugid() == 0)
 		s=getenv("RANDFILE");
-	if (s != NULL && *s && strlen(s) + 1 < size)
+	if (s != NULL)
 		{
-		strlcpy(buf,s,size);
+		strncpy(buf,s,size-1);
+		buf[size-1]='\0';
 		ret=buf;
 		}
 	else
@@ -240,13 +241,13 @@
 			s = DEFAULT_HOME;
 			}
 #endif
-		if (s != NULL && *s && (strlen(s)+strlen(RFILE)+2 < size))
+		if (s != NULL && (strlen(s)+strlen(RFILE)+2 < size))
 			{
-			strlcpy(buf,s,size);
+			strcpy(buf,s);
 #ifndef VMS
-			strlcat(buf,"/",size);
+			strcat(buf,"/");
 #endif
-			strlcat(buf,RFILE,size);
+			strcat(buf,RFILE);
 			ret=buf;
 			}
 		else