From owner-p4-projects@FreeBSD.ORG Thu Jun 21 11:13:10 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id B42DA16A469; Thu, 21 Jun 2007 11:13:10 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6CFB216A421 for ; Thu, 21 Jun 2007 11:13:10 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 5E78C13C45B for ; Thu, 21 Jun 2007 11:13:10 +0000 (UTC) (envelope-from rdivacky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5LBDAUj040181 for ; Thu, 21 Jun 2007 11:13:10 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5LBDA4Y040178 for perforce@freebsd.org; Thu, 21 Jun 2007 11:13:10 GMT (envelope-from rdivacky@FreeBSD.org) Date: Thu, 21 Jun 2007 11:13:10 GMT Message-Id: <200706211113.l5LBDA4Y040178@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky To: Perforce Change Reviews Cc: Subject: PERFORCE change 122087 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2007 11:13:11 -0000 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] == '/');