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 15c56c8ebbd8315a3c62a5aa20866d1359c7d66a..4c2e984c12150e2ced5878317a0b67d74b4dc6af 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 a66f520625d23c2c80d611c835eb144b02f8f42b..7fff24f05b0d792416c256484d260cb54c5c4a08 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