summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-06-09 02:36:04 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2002-06-09 02:36:04 +0000
commitd1e2028ffb43811e5f41ac689ed0a491256f7cc2 (patch)
treea6852b01d2e5fd960c967c7f7c19b26a68c6d83c
parent9d88e955dcdc2e5d812dd9c2cd56b548cd01c3ad (diff)
strlcpy fix, PR 2727
-rw-r--r--bin/pax/cpio.c6
-rw-r--r--bin/pax/pat_rep.c8
-rw-r--r--usr.bin/ftp/ftp.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c
index d6e516fe391..c9d4ef9bca1 100644
--- a/bin/pax/cpio.c
+++ b/bin/pax/cpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpio.c,v 1.9 2002/02/19 19:39:35 millert Exp $ */
+/* $OpenBSD: cpio.c,v 1.10 2002/06/09 02:35:27 itojun Exp $ */
/* $NetBSD: cpio.c,v 1.5 1995/03/21 09:07:13 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: cpio.c,v 1.9 2002/02/19 19:39:35 millert Exp $";
+static char rcsid[] = "$OpenBSD: cpio.c,v 1.10 2002/06/09 02:35:27 itojun Exp $";
#endif
#endif /* not lint */
@@ -174,7 +174,7 @@ cpio_endwr(void)
last.nlen = sizeof(TRAILER) - 1;
last.type = PAX_REG;
last.sb.st_nlink = 1;
- (void)strcpy(last.name, TRAILER);
+ (void)strlcpy(last.name, TRAILER, sizeof(last.name));
return((*frmt->wr)(&last));
}
diff --git a/bin/pax/pat_rep.c b/bin/pax/pat_rep.c
index f88ce717c12..b0f53cfe620 100644
--- a/bin/pax/pat_rep.c
+++ b/bin/pax/pat_rep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pat_rep.c,v 1.17 2002/02/19 19:39:35 millert Exp $ */
+/* $OpenBSD: pat_rep.c,v 1.18 2002/06/09 02:35:27 itojun Exp $ */
/* $NetBSD: pat_rep.c,v 1.4 1995/03/21 09:07:33 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.17 2002/02/19 19:39:35 millert Exp $";
+static char rcsid[] = "$OpenBSD: pat_rep.c,v 1.18 2002/06/09 02:35:27 itojun Exp $";
#endif
#endif /* not lint */
@@ -880,7 +880,7 @@ rep_name(char *name, int *nlen, int prnt)
* (the user already saw that substitution go by)
*/
pt = rephead;
- (void)strcpy(buf1, name);
+ (void)strlcpy(buf1, name, sizeof(buf1));
inpt = buf1;
outpt = nname;
endpt = outpt + PAXPATHLEN;
@@ -990,7 +990,7 @@ rep_name(char *name, int *nlen, int prnt)
*/
if (*nname == '\0')
return(1);
- *nlen = strlcpy(name, nname, sizeof(nname));
+ *nlen = strlcpy(name, nname, sizeof(name));
}
return(0);
}
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 6626c2e3973..dc4b122ae33 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.47 2002/06/09 00:40:29 itojun Exp $ */
+/* $OpenBSD: ftp.c,v 1.48 2002/06/09 02:36:03 itojun Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-static char rcsid[] = "$OpenBSD: ftp.c,v 1.47 2002/06/09 00:40:29 itojun Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.48 2002/06/09 02:36:03 itojun Exp $";
#endif
#endif /* not lint */
@@ -431,7 +431,7 @@ getreply(expecteof)
if (len > sizeof(reply_string))
len = sizeof(reply_string);
- (void)strlcpy(reply_string, current_line, len + 1);
+ (void)strlcpy(reply_string, current_line, len);
}
if (continuation && code != originalcode) {
if (originalcode == 0)