Date: Thu, 21 Jun 2007 11:13:10 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 122087 for review Message-ID: <200706211113.l5LBDA4Y040178@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122087 Change 122087 by rdivacky@rdivacky_witten on 2007/06/21 11:13:03 Dont copy whole path from userland when we need only the first char. Also we dont use len so dont care filling it. Pointed out by: netchild Affected files ... .. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#23 edit Differences ... ==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/vfs_syscalls.c#23 (text+ko) ==== @@ -988,13 +988,13 @@ /* Check whether a path is an absolute path. */ static int kern_absolute_path(char *path, enum uio_seg pathseg) { - int error, len; - char buf[PATH_MAX]; + int error; + char buf[1]; if (pathseg == UIO_SYSSPACE) { return (path[0] == '/'); } else { - error = copyinstr(path, buf, PATH_MAX, &len); + error = copyinstr(path, buf, 1, NULL); if (error) return 1; /* we want to fail */ return (buf[0] == '/');
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706211113.l5LBDA4Y040178>