summaryrefslogtreecommitdiff
path: root/usr.sbin/mtree/verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/mtree/verify.c')
-rw-r--r--usr.sbin/mtree/verify.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c
index 63ddf7e855b..cd60ea8d9ba 100644
--- a/usr.sbin/mtree/verify.c
+++ b/usr.sbin/mtree/verify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: verify.c,v 1.11 2002/03/14 16:44:25 mpech Exp $ */
+/* $OpenBSD: verify.c,v 1.12 2003/04/19 10:43:55 henning Exp $ */
/* $NetBSD: verify.c,v 1.10 1995/03/07 21:26:28 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static const char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93";
#else
-static const char rcsid[] = "$OpenBSD: verify.c,v 1.11 2002/03/14 16:44:25 mpech Exp $";
+static const char rcsid[] = "$OpenBSD: verify.c,v 1.12 2003/04/19 10:43:55 henning Exp $";
#endif
#endif /* not lint */
@@ -61,7 +61,7 @@ extern char fullpath[MAXPATHLEN];
static NODE *root;
static char path[MAXPATHLEN];
-static void miss(NODE *, char *);
+static void miss(NODE *, char *, size_t);
static int vwalk(void);
int
@@ -71,7 +71,7 @@ verify()
root = spec();
rval = vwalk();
- miss(root, path);
+ miss(root, path, sizeof(path));
return (rval);
}
@@ -157,9 +157,10 @@ extra:
}
static void
-miss(p, tail)
+miss(p, tail, len)
NODE *p;
char *tail;
+ size_t len;
{
int create;
char *tp;
@@ -169,7 +170,7 @@ miss(p, tail)
continue;
if (p->type != F_DIR && (dflag || p->flags & F_VISIT))
continue;
- (void)strcpy(tail, p->name);
+ (void)strlcpy(tail, p->name, len);
if (!(p->flags & F_VISIT)) {
/* Don't print missing message if file exists as a
symbolic link and the -q flag is set. */
@@ -207,7 +208,7 @@ miss(p, tail)
for (tp = tail; *tp; ++tp);
*tp = '/';
- miss(p->child, tp + 1);
+ miss(p->child, tp + 1, len - (tp + 1 - tail));
*tp = '\0';
if (!create)