Fix a panic in the __getcwd(2) syscall.
authorSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 09:19:09 +0000 (11:19 +0200)
committerSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 09:19:09 +0000 (11:19 +0200)
buflen has to be unsigned so that large values do not become negative
and sneak past the MAXPATHLEN check.

sys/kern/vfs_cache.c

index 7abf072..6166e70 100644 (file)
@@ -2951,7 +2951,7 @@ static u_long numcwdfound; STATNODE(CTLFLAG_RD, numcwdfound, &numcwdfound);
 int
 sys___getcwd(struct __getcwd_args *uap)
 {
-       int buflen;
+       u_int buflen;
        int error;
        char *buf;
        char *bp;