summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_install/add/perform.c6
-rw-r--r--usr.sbin/pkg_install/lib/file.c9
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index a34829350c6..bb9aed521ae 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.25 2003/04/05 18:04:00 avsm Exp $ */
+/* $OpenBSD: perform.c,v 1.26 2003/04/19 10:46:16 henning Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: perform.c,v 1.25 2003/04/05 18:04:00 avsm Exp $";
+static const char *rcsid = "$OpenBSD: perform.c,v 1.26 2003/04/19 10:46:16 henning Exp $";
#endif
/*
@@ -506,7 +506,7 @@ pkg_do(char *pkg)
if (s != NULL) {
char *t;
t=strrchr(contents, '/');
- strcpy(t+1, s);
+ strlcpy(t+1, s, contents + sizeof(contents) - (t+1));
}else{
errx(1,"Where did our dependency go?!");
/* this shouldn't happen... X-) */
diff --git a/usr.sbin/pkg_install/lib/file.c b/usr.sbin/pkg_install/lib/file.c
index 4cdf07bba89..352caf82848 100644
--- a/usr.sbin/pkg_install/lib/file.c
+++ b/usr.sbin/pkg_install/lib/file.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: file.c,v 1.16 2003/04/04 08:56:01 avsm Exp $ */
+/* $OpenBSD: file.c,v 1.17 2003/04/19 10:46:16 henning Exp $ */
#ifndef lint
-static const char *rcsid = "$OpenBSD: file.c,v 1.16 2003/04/04 08:56:01 avsm Exp $";
+static const char *rcsid = "$OpenBSD: file.c,v 1.17 2003/04/19 10:46:16 henning Exp $";
#endif
/*
@@ -403,7 +403,8 @@ fileFindByPath(char *base, char *fname)
char *s;
s=strrchr(tmp,'/');
assert(s != NULL);
- strcpy(s+1, cp);
+ strlcpy(s+1, cp,
+ tmp + sizeof(tmp) - (s+1));
return tmp;
}
} else {
@@ -427,7 +428,7 @@ fileFindByPath(char *base, char *fname)
if (s){
char *t;
t=strrchr(tmp, '/');
- strcpy(t+1, s);
+ strlcpy(t+1, s, tmp + sizeof(tmp) - (t+1));
return tmp;
}
} else {