summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2003-04-19 10:46:17 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2003-04-19 10:46:17 +0000
commit12c960e4c7254a234699fc541b247549f6a19fba (patch)
tree1f4d6fa8f7f4e7509828f7e9d60bcfa12af33c53 /usr.sbin
parent3c50b9a767115d5e1958286e69c0c39dcd513d93 (diff)
string stuff, ok krw@ deraadt@
Diffstat (limited to 'usr.sbin')
-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 {