summaryrefslogtreecommitdiff
path: root/security/openssl/files/patch-netbsd-1.4.2
blob: ef99a2edf8726b0994c34acadc9998a356747467 (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
36
37
$NetBSD: patch-netbsd-1.4.2,v 1.2 2002/08/25 19:23:18 jlam Exp $

Revert the addition of strlcpy() and strlcat(), for NetBSD-1.4.2.

--- 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