From owner-svn-src-stable@freebsd.org Wed Jun 1 17:35:04 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67C86B61FAC; Wed, 1 Jun 2016 17:35:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34AA91751; Wed, 1 Jun 2016 17:35:04 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u51HZ3qm056122; Wed, 1 Jun 2016 17:35:03 GMT (envelope-from truckman@FreeBSD.org) Received: (from truckman@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u51HZ3Ep056121; Wed, 1 Jun 2016 17:35:03 GMT (envelope-from truckman@FreeBSD.org) Message-Id: <201606011735.u51HZ3Ep056121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: truckman set sender to truckman@FreeBSD.org using -f From: Don Lewis Date: Wed, 1 Jun 2016 17:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r301149 - stable/10/bin/setfacl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2016 17:35:04 -0000 Author: truckman Date: Wed Jun 1 17:35:03 2016 New Revision: 301149 URL: https://svnweb.freebsd.org/changeset/base/301149 Log: MFC r300649 Fix Coverity CID 1019054 (String not null terminated) in setfacl. Increase the size of buf[] by one to allow room for a NUL character at the end. Reported by: Coverity CID: 1019054 Modified: stable/10/bin/setfacl/file.c Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/setfacl/file.c ============================================================================== --- stable/10/bin/setfacl/file.c Wed Jun 1 17:33:02 2016 (r301148) +++ stable/10/bin/setfacl/file.c Wed Jun 1 17:35:03 2016 (r301149) @@ -43,7 +43,7 @@ acl_t get_acl_from_file(const char *filename) { FILE *file; - char buf[BUFSIZ]; + char buf[BUFSIZ+1]; if (filename == NULL) err(1, "(null) filename in get_acl_from_file()"); @@ -61,7 +61,7 @@ get_acl_from_file(const char *filename) err(1, "fopen() %s failed", filename); } - fread(buf, sizeof(buf), (size_t)1, file); + fread(buf, sizeof(buf) - 1, (size_t)1, file); if (ferror(file) != 0) { fclose(file); err(1, "error reading from %s", filename);