openbsd-ports/sysutils/cfengine/patches/patch-src_filedir_c
2005-07-21 15:16:46 +00:00

49 lines
1.5 KiB
Plaintext

$OpenBSD: patch-src_filedir_c,v 1.2 2005/07/21 15:16:46 aanriot Exp $
--- src/filedir.c.orig Sun May 29 07:40:33 2005
+++ src/filedir.c Fri Jul 15 12:24:01 2005
@@ -169,7 +169,7 @@ for (dirp = readdir(dirh); dirp != NULL;
continue;
}
- strcpy(pcwd,name); /* Assemble pathname */
+ (void)strlcpy(pcwd,name,sizeof(pcwd)); /* Assemble pathname */
AddSlash(pcwd);
if (BufferOverflow(pcwd,dirp->d_name))
@@ -178,7 +178,7 @@ for (dirp = readdir(dirh); dirp != NULL;
return true;
}
- strcat(pcwd,dirp->d_name);
+ (void)strlcat(pcwd,dirp->d_name,sizeof(pcwd));
if (lstat(dirp->d_name,&statbuf) == -1)
{
@@ -1181,7 +1181,7 @@ int CheckHomeSubDir(char *testpath,char
if (strncmp(tidypath,"home/",5) == 0)
{
- strcpy(buffer,testpath);
+ (void)strlcpy(buffer,testpath,sizeof(buffer));
for (ChopLastNode(buffer); strlen(buffer) != 0; ChopLastNode(buffer))
{
@@ -1202,7 +1202,7 @@ if (strncmp(tidypath,"home/",5) == 0)
subdirstart = tidypath + 4; /* Ptr to start of subdir */
- strcpy(buffer,testpath);
+ (void)strlcpy(buffer,testpath,sizeof(buffer));
ChopLastNode(buffer); /* Filename only */
@@ -1272,7 +1272,7 @@ if (name == NULL || strlen(name) == 0)
strncpy(VBUFF,pathto,CF_BUFSIZE-1);
AddSlash(VBUFF);
-strcat(VBUFF,name);
+(void)strlcat(VBUFF,name,sizeof(VBUFF));
if (ignores != NULL)
{