summaryrefslogtreecommitdiff
path: root/usr.bin/sup
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-18 19:13:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-05-18 19:13:40 +0000
commitd51d6214fa2abd8ab575dfad3ef0690ab2a096d6 (patch)
treed11a883bf092b8f77001a674d42769deeb1a3367 /usr.bin/sup
parentef77d4ef152a7f3529fa71b2c2eaedb17241d696 (diff)
readlink len-1
Diffstat (limited to 'usr.bin/sup')
-rw-r--r--usr.bin/sup/src/supcmeat.c4
-rw-r--r--usr.bin/sup/src/supfilesrv.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/sup/src/supcmeat.c b/usr.bin/sup/src/supcmeat.c
index f0cafda6ffa..230cb6a04f8 100644
--- a/usr.bin/sup/src/supcmeat.c
+++ b/usr.bin/sup/src/supcmeat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supcmeat.c,v 1.8 1997/09/16 11:01:20 deraadt Exp $ */
+/* $OpenBSD: supcmeat.c,v 1.9 1998/05/18 19:13:37 deraadt Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -837,7 +837,7 @@ register struct stat *statp;
}
linkname = t->Tlink->Tname;
if (!new && (t->Tflags&FNEW) == 0 &&
- (n = readlink (t->Tname,buf,sizeof(buf))) >= 0 &&
+ (n = readlink (t->Tname,buf,sizeof(buf)-1)) >= 0 &&
(n == strlen (linkname)) && (strncmp (linkname,buf,n) == 0))
return (FALSE);
if (thisC->Cflags&CFLIST) {
diff --git a/usr.bin/sup/src/supfilesrv.c b/usr.bin/sup/src/supfilesrv.c
index 70150da5040..dae2c03811a 100644
--- a/usr.bin/sup/src/supfilesrv.c
+++ b/usr.bin/sup/src/supfilesrv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: supfilesrv.c,v 1.13 1997/11/17 08:54:05 deraadt Exp $ */
+/* $OpenBSD: supfilesrv.c,v 1.14 1998/05/18 19:13:39 deraadt Exp $ */
/*
* Copyright (c) 1992 Carnegie Mellon University
@@ -1057,7 +1057,7 @@ void *v;
}
switch (t->Tmode&S_IFMT) {
case S_IFLNK:
- if ((x = readlink (name,slinkname,STRINGLENGTH)) <= 0) {
+ if ((x = readlink (name,slinkname,STRINGLENGTH-1)) <= 0) {
(void) Tinsert (&denyT,name,FALSE);
return (SCMOK);
}