From owner-svn-src-stable-9@freebsd.org Tue Sep 22 22:07:42 2015 Return-Path: Delivered-To: svn-src-stable-9@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 E6598A07823; Tue, 22 Sep 2015 22:07:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D63A11C44; Tue, 22 Sep 2015 22:07:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MM7gax066253; Tue, 22 Sep 2015 22:07:42 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MM7gRc066252; Tue, 22 Sep 2015 22:07:42 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222207.t8MM7gRc066252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288133 - in stable: 10/contrib/gcclibs/libcpp 9/contrib/gcclibs/libcpp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:07:43 -0000 Author: dim Date: Tue Sep 22 22:07:42 2015 New Revision: 288133 URL: https://svnweb.freebsd.org/changeset/base/288133 Log: MFC r286699: In gcc's libcpp, stop using the INTTYPE_MAXIMUM() macro, which relies on undefined behavior. The code used this macro to avoid problems on some broken systems which define SSIZE_MAX incorrectly, but this is not needed on FreeBSD, obviously. Modified: stable/9/contrib/gcclibs/libcpp/files.c Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/gcclibs/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/gcclibs/libcpp/files.c Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/gcclibs/libcpp/files.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/files.c Tue Sep 22 21:43:08 2015 (r288132) +++ stable/9/contrib/gcclibs/libcpp/files.c Tue Sep 22 22:07:42 2015 (r288133) @@ -567,7 +567,7 @@ read_file_guts (cpp_reader *pfile, _cpp_ SSIZE_MAX to be much smaller than the actual range of the type. Use INTTYPE_MAXIMUM unconditionally to ensure this does not bite us. */ - if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t)) + if (file->st.st_size > SSIZE_MAX) { cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path); return false; @@ -581,7 +581,7 @@ read_file_guts (cpp_reader *pfile, _cpp_ file->path); return false; } - else if (offset > INTTYPE_MAXIMUM (ssize_t) || (ssize_t)offset > size) + else if (offset > SSIZE_MAX || (ssize_t)offset > size) { cpp_error (pfile, CPP_DL_ERROR, "current position of %s is too large", file->path); From owner-svn-src-stable-9@freebsd.org Tue Sep 22 22:18:37 2015 Return-Path: Delivered-To: svn-src-stable-9@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 90B68A07D43; Tue, 22 Sep 2015 22:18:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 8125E1318; Tue, 22 Sep 2015 22:18:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MMIbi0070500; Tue, 22 Sep 2015 22:18:37 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MMIbQd070499; Tue, 22 Sep 2015 22:18:37 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222218.t8MMIbQd070499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288134 - in stable: 10/sbin/ipfw 9/sbin/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:18:37 -0000 Author: dim Date: Tue Sep 22 22:18:36 2015 New Revision: 288134 URL: https://svnweb.freebsd.org/changeset/base/288134 Log: MFC r286702: In ipfw2, avoid left-shifting negative integers, which is undefined. While here, make some other arguments to htonl(3) unsigned too. Modified: stable/9/sbin/ipfw/ipfw2.c Directory Properties: stable/9/ (props changed) stable/9/sbin/ (props changed) stable/9/sbin/ipfw/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/ipfw/ipfw2.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/ipfw/ipfw2.c ============================================================================== --- stable/9/sbin/ipfw/ipfw2.c Tue Sep 22 22:07:42 2015 (r288133) +++ stable/9/sbin/ipfw/ipfw2.c Tue Sep 22 22:18:36 2015 (r288134) @@ -2267,14 +2267,14 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int case '/': masklen = atoi(p); if (masklen == 0) - d[1] = htonl(0); /* mask */ + d[1] = htonl(0U); /* mask */ else if (masklen > 32) errx(EX_DATAERR, "bad width ``%s''", p); else - d[1] = htonl(~0 << (32 - masklen)); + d[1] = htonl(~0U << (32 - masklen)); break; case '{': /* no mask, assume /24 and put back the '{' */ - d[1] = htonl(~0 << (32 - 24)); + d[1] = htonl(~0U << (32 - 24)); *(--p) = md; break; @@ -2283,7 +2283,7 @@ fill_ip(ipfw_insn_ip *cmd, char *av, int /* FALLTHROUGH */ case 0: /* initialization value */ default: - d[1] = htonl(~0); /* force /32 */ + d[1] = htonl(~0U); /* force /32 */ break; } d[0] &= d[1]; /* mask base address with mask */ From owner-svn-src-stable-9@freebsd.org Tue Sep 22 22:27:46 2015 Return-Path: Delivered-To: svn-src-stable-9@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 5C7E7A06245; Tue, 22 Sep 2015 22:27:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 4CBF11BC8; Tue, 22 Sep 2015 22:27:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MMRk9t074587; Tue, 22 Sep 2015 22:27:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MMRkkY074586; Tue, 22 Sep 2015 22:27:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222227.t8MMRkkY074586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288135 - in stable: 10/sys/dev/bxe 9/sys/dev/bxe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:27:46 -0000 Author: dim Date: Tue Sep 22 22:27:45 2015 New Revision: 288135 URL: https://svnweb.freebsd.org/changeset/base/288135 Log: MFC r286733: Avoid left-shifting negative signed values in bxe(4). Reviewed by: davidcs Modified: stable/9/sys/dev/bxe/ecore_hsi.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/bxe/ecore_hsi.h Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/bxe/ecore_hsi.h ============================================================================== --- stable/9/sys/dev/bxe/ecore_hsi.h Tue Sep 22 22:18:36 2015 (r288134) +++ stable/9/sys/dev/bxe/ecore_hsi.h Tue Sep 22 22:27:45 2015 (r288135) @@ -2536,9 +2536,9 @@ struct shmem2_region { #define SHMEM_EEE_SUPPORTED_MASK 0x000f0000 #define SHMEM_EEE_SUPPORTED_SHIFT 16 #define SHMEM_EEE_ADV_STATUS_MASK 0x00f00000 - #define SHMEM_EEE_100M_ADV (1<<0) - #define SHMEM_EEE_1G_ADV (1<<1) - #define SHMEM_EEE_10G_ADV (1<<2) + #define SHMEM_EEE_100M_ADV (1U<<0) + #define SHMEM_EEE_1G_ADV (1U<<1) + #define SHMEM_EEE_10G_ADV (1U<<2) #define SHMEM_EEE_ADV_STATUS_SHIFT 20 #define SHMEM_EEE_LP_ADV_STATUS_MASK 0x0f000000 #define SHMEM_EEE_LP_ADV_STATUS_SHIFT 24 From owner-svn-src-stable-9@freebsd.org Tue Sep 22 22:35:43 2015 Return-Path: Delivered-To: svn-src-stable-9@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 7789BA06798; Tue, 22 Sep 2015 22:35:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 67D3D12FF; Tue, 22 Sep 2015 22:35:43 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8MMZhdc078843; Tue, 22 Sep 2015 22:35:43 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8MMZhGK078842; Tue, 22 Sep 2015 22:35:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509222235.t8MMZhGK078842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 22 Sep 2015 22:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288136 - in stable: 10/lib/libz 9/lib/libz X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Sep 2015 22:35:43 -0000 Author: dim Date: Tue Sep 22 22:35:42 2015 New Revision: 288136 URL: https://svnweb.freebsd.org/changeset/base/288136 Log: MFC r287541: In libz's inflateMark(), avoid left-shifting a negative integer, which is undefined. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D3344 Modified: stable/9/lib/libz/inflate.c Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libz/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libz/inflate.c Directory Properties: stable/10/ (props changed) Modified: stable/9/lib/libz/inflate.c ============================================================================== --- stable/9/lib/libz/inflate.c Tue Sep 22 22:27:45 2015 (r288135) +++ stable/9/lib/libz/inflate.c Tue Sep 22 22:35:42 2015 (r288136) @@ -1504,7 +1504,7 @@ z_streamp strm; { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16); state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : From owner-svn-src-stable-9@freebsd.org Thu Sep 24 09:35:35 2015 Return-Path: Delivered-To: svn-src-stable-9@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 EAF52A08346; Thu, 24 Sep 2015 09:35:35 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 DB27D18FA; Thu, 24 Sep 2015 09:35:35 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8O9ZZlY049570; Thu, 24 Sep 2015 09:35:35 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8O9ZZbd049569; Thu, 24 Sep 2015 09:35:35 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201509240935.t8O9ZZbd049569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Thu, 24 Sep 2015 09:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288168 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2015 09:35:36 -0000 Author: smh Date: Thu Sep 24 09:35:35 2015 New Revision: 288168 URL: https://svnweb.freebsd.org/changeset/base/288168 Log: MFC r287886: Fix kqueue write events for files > 2GB Relnotes: YES Sponsored by: Multiplay Modified: stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Thu Sep 24 08:42:08 2015 (r288167) +++ stable/9/sys/sys/vnode.h Thu Sep 24 09:35:35 2015 (r288168) @@ -768,7 +768,8 @@ void vop_rename_fail(struct vop_rename_a #define VOP_WRITE_PRE(ap) \ struct vattr va; \ - int error, osize, ooffset, noffset; \ + int error; \ + off_t osize, ooffset, noffset; \ \ osize = ooffset = noffset = 0; \ if (!VN_KNLIST_EMPTY((ap)->a_vp)) { \ @@ -776,7 +777,7 @@ void vop_rename_fail(struct vop_rename_a if (error) \ return (error); \ ooffset = (ap)->a_uio->uio_offset; \ - osize = va.va_size; \ + osize = (off_t)va.va_size; \ } #define VOP_WRITE_POST(ap, ret) \ From owner-svn-src-stable-9@freebsd.org Thu Sep 24 19:42:33 2015 Return-Path: Delivered-To: svn-src-stable-9@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 04DDBA07EEB; Thu, 24 Sep 2015 19:42:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 E9B86128F; Thu, 24 Sep 2015 19:42:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8OJgW4P006424; Thu, 24 Sep 2015 19:42:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8OJgW9K006423; Thu, 24 Sep 2015 19:42:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201509241942.t8OJgW9K006423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 24 Sep 2015 19:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288186 - stable/9/games/grdc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2015 19:42:33 -0000 Author: emaste Date: Thu Sep 24 19:42:32 2015 New Revision: 288186 URL: https://svnweb.freebsd.org/changeset/base/288186 Log: MFC r283929: Correct grdc(1) 12-hour display between 12:00 and 13:00 PM starts at 12:00, not 13:00. PR: 194291, 200133 Submitted by: Nick Price Modified: stable/9/games/grdc/grdc.c Directory Properties: stable/9/games/grdc/ (props changed) Modified: stable/9/games/grdc/grdc.c ============================================================================== --- stable/9/games/grdc/grdc.c Thu Sep 24 19:37:34 2015 (r288185) +++ stable/9/games/grdc/grdc.c Thu Sep 24 19:42:32 2015 (r288186) @@ -150,14 +150,14 @@ main(int argc, char *argv[]) set(tm->tm_min/10, 14); if (t12) { - if (tm->tm_hour > 12) { - tm->tm_hour -= 12; - mvaddstr(YBASE + 5, XBASE + 52, "PM"); - } else { + if (tm->tm_hour < 12) { if (tm->tm_hour == 0) tm->tm_hour = 12; - mvaddstr(YBASE + 5, XBASE + 52, "AM"); + } else { + if (tm->tm_hour > 12) + tm->tm_hour -= 12; + mvaddstr(YBASE + 5, XBASE + 52, "PM"); } } From owner-svn-src-stable-9@freebsd.org Fri Sep 25 01:17:52 2015 Return-Path: Delivered-To: svn-src-stable-9@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 E701BA0960F; Fri, 25 Sep 2015 01:17:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 D732613C0; Fri, 25 Sep 2015 01:17:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8P1Hq83046574; Fri, 25 Sep 2015 01:17:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8P1HqwO046573; Fri, 25 Sep 2015 01:17:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201509250117.t8P1HqwO046573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 25 Sep 2015 01:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r288206 - stable/9/usr.sbin/gstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2015 01:17:53 -0000 Author: delphij Date: Fri Sep 25 01:17:52 2015 New Revision: 288206 URL: https://svnweb.freebsd.org/changeset/base/288206 Log: MFC r287650: Use strlcpy() in favor of strncpy() as it's defined to have a nul character at the end of string buffer, and the code context do expects this to behave correctly (e.g. strchr). Modified: stable/9/usr.sbin/gstat/gstat.c Directory Properties: stable/9/usr.sbin/gstat/ (props changed) Modified: stable/9/usr.sbin/gstat/gstat.c ============================================================================== --- stable/9/usr.sbin/gstat/gstat.c Fri Sep 25 01:17:24 2015 (r288205) +++ stable/9/usr.sbin/gstat/gstat.c Fri Sep 25 01:17:52 2015 (r288206) @@ -124,7 +124,7 @@ main(int argc, char **argv) if (regcomp(&f_re, optarg, REG_EXTENDED) != 0) errx(EX_USAGE, "Invalid filter - see re_format(7)"); - strncpy(f_s, optarg, sizeof(f_s)); + strlcpy(f_s, optarg, sizeof(f_s)); break; case 'I': p = NULL; @@ -210,7 +210,7 @@ main(int argc, char **argv) getyx(stdscr, cury, curx); getmaxyx(stdscr, maxy, maxx); } - strncpy(pf_s, f_s, sizeof(pf_s)); + strlcpy(pf_s, f_s, sizeof(pf_s)); max_flen = maxx - curx - 1; if ((int)strlen(f_s) > max_flen && max_flen >= 0) { if (max_flen > 3) @@ -382,7 +382,7 @@ main(int argc, char **argv) err(1, "el_gets"); if (line_len > 1) history(hist, &hist_ev, H_ENTER, line); - strncpy(tmp_f_s, line, sizeof(f_s)); + strlcpy(tmp_f_s, line, sizeof(f_s)); if ((p = strchr(tmp_f_s, '\n')) != NULL) *p = '\0'; /* @@ -399,7 +399,7 @@ main(int argc, char **argv) refresh(); sleep(1); } else { - strncpy(f_s, tmp_f_s, sizeof(f_s)); + strlcpy(f_s, tmp_f_s, sizeof(f_s)); f_re = tmp_f_re; } break;