From owner-svn-src-head@FreeBSD.ORG Thu May 28 07:20:52 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBA651065673; Thu, 28 May 2009 07:20:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA3F68FC17; Thu, 28 May 2009 07:20:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4S7Kq6S026822; Thu, 28 May 2009 07:20:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4S7KqFL026821; Thu, 28 May 2009 07:20:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200905280720.n4S7KqFL026821@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 28 May 2009 07:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r192966 - head/lib/libc/posix1e X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 May 2009 07:20:53 -0000 Author: trasz Date: Thu May 28 07:20:52 2009 New Revision: 192966 URL: http://svn.freebsd.org/changeset/base/192966 Log: Fix off by one error in acl_create_entry(3). Reviewed by: rwatson@ MFC after: 2 weeks Modified: head/lib/libc/posix1e/acl_entry.c Modified: head/lib/libc/posix1e/acl_entry.c ============================================================================== --- head/lib/libc/posix1e/acl_entry.c Thu May 28 07:15:08 2009 (r192965) +++ head/lib/libc/posix1e/acl_entry.c Thu May 28 07:20:52 2009 (r192966) @@ -51,7 +51,12 @@ acl_create_entry(acl_t *acl_p, acl_entry acl_int = &(*acl_p)->ats_acl; - if ((acl_int->acl_cnt >= ACL_MAX_ENTRIES) || (acl_int->acl_cnt < 0)) { + /* + * +1, because we are checking if there is space left for one more + * entry. + */ + if ((acl_int->acl_cnt + 1 >= ACL_MAX_ENTRIES) || + (acl_int->acl_cnt < 0)) { errno = EINVAL; return (-1); }