From owner-svn-src-all@FreeBSD.ORG Fri Dec 14 08:53:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2D88304; Fri, 14 Dec 2012 08:53:25 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 983878FC12; Fri, 14 Dec 2012 08:53:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBE8rPAE027017; Fri, 14 Dec 2012 08:53:25 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBE8rPHm027016; Fri, 14 Dec 2012 08:53:25 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201212140853.qBE8rPHm027016@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 14 Dec 2012 08:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r244205 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 08:53:25 -0000 Author: bapt Date: Fri Dec 14 08:53:25 2012 New Revision: 244205 URL: http://svnweb.freebsd.org/changeset/base/244205 Log: MRC r243021: return ERANGE if the buffer is too small to contain the login as documented in the manpage Reviewed by: cognet, kib Modified: stable/8/sys/kern/kern_prot.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_prot.c ============================================================================== --- stable/8/sys/kern/kern_prot.c Fri Dec 14 08:52:08 2012 (r244204) +++ stable/8/sys/kern/kern_prot.c Fri Dec 14 08:53:25 2012 (r244205) @@ -2065,6 +2065,8 @@ getlogin(struct thread *td, struct getlo bcopy(p->p_session->s_login, login, uap->namelen); SESS_UNLOCK(p->p_session); PROC_UNLOCK(p); + if (strlen(login) + 1 > uap->namelen) + return (ERANGE); error = copyout(login, uap->namebuf, uap->namelen); return (error); }