PERFORCE change 122087 for review
Roman Divacky
rdivacky at FreeBSD.org
Thu Jun 21 11:13:11 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=122087
Change 122087 by rdivacky at 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] == '/');
More information about the p4-projects
mailing list