changed a couple of places to use strlcpy()
authorAndrew Tridgell <tridge@samba.org>
Sun, 10 May 1998 12:37:26 +0000 (12:37 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sun, 10 May 1998 12:37:26 +0000 (12:37 +0000)
flist.c
loadparm.c

diff --git a/flist.c b/flist.c
index 15c56c8..4c2e984 100644 (file)
--- a/flist.c
+++ b/flist.c
@@ -872,7 +872,7 @@ char *f_name(struct file_struct *f)
        if (f->dirname) {
                sprintf(p, "%s/%s", f->dirname, f->basename);
        } else {
-               strcpy(p, f->basename);
+               strlcpy(p, f->basename, MAXPATHLEN-1);
        }
 
        return p;
index a66f520..7fff24f 100644 (file)
@@ -52,7 +52,7 @@
 #define strequal(a,b) (strcasecmp(a,b)==0)
 #define BOOLSTR(b) ((b) ? "Yes" : "No")
 typedef char pstring[1024];
-#define pstrcpy(a,b) strcpy(a,b)
+#define pstrcpy(a,b) strlcpy(a,b,sizeof(pstring)-1)
 
 /* the following are used by loadparm for option lists */
 typedef enum