From owner-svn-ports-all@freebsd.org Sun Aug 11 22:24:52 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E1D6C45D5; Sun, 11 Aug 2019 22:24:52 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 466D782Hlfz4THn; Sun, 11 Aug 2019 22:24:52 +0000 (UTC) (envelope-from jbeich@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BDC91D02E; Sun, 11 Aug 2019 22:24:52 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7BMOqqZ026955; Sun, 11 Aug 2019 22:24:52 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7BMOorQ026943; Sun, 11 Aug 2019 22:24:50 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201908112224.x7BMOorQ026943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Sun, 11 Aug 2019 22:24:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r508689 - in head/games: openbor openbor/files openbor3482 openbor3482/files openbor3711 openbor3979 openbor3979/files openbor4432 openbor4432/files X-SVN-Group: ports-head X-SVN-Commit-Author: jbeich X-SVN-Commit-Paths: in head/games: openbor openbor/files openbor3482 openbor3482/files openbor3711 openbor3979 openbor3979/files openbor4432 openbor4432/files X-SVN-Commit-Revision: 508689 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Aug 2019 22:24:52 -0000 Author: jbeich Date: Sun Aug 11 22:24:49 2019 New Revision: 508689 URL: https://svnweb.freebsd.org/changeset/ports/508689 Log: games/openbor: fix free memory stats source/ramlib/ram.c:137:18: runtime error: unsigned integer overflow: 9420649 * 4096 cannot be represented in type 'unsigned int' Reported by: -fsanitize=integer Modified: head/games/openbor/Makefile (contents, props changed) head/games/openbor/files/patch-source_ramlib_ram.c (contents, props changed) head/games/openbor3482/Makefile (contents, props changed) head/games/openbor3482/files/patch-source_ramlib_ram.c (contents, props changed) head/games/openbor3711/Makefile (contents, props changed) head/games/openbor3979/Makefile (contents, props changed) head/games/openbor3979/files/patch-source_ramlib_ram.c (contents, props changed) head/games/openbor4432/Makefile (contents, props changed) head/games/openbor4432/files/patch-source_ramlib_ram.c (contents, props changed) Modified: head/games/openbor/Makefile ============================================================================== --- head/games/openbor/Makefile Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor/Makefile Sun Aug 11 22:24:49 2019 (r508689) @@ -4,7 +4,7 @@ PORTNAME= openbor # Hint: svn revision is git rev-list --count ${GH_TAGNAME} PORTVERSION?= 7068 .ifndef PKGNAMESUFFIX -PORTREVISION= 0 +PORTREVISION= 1 .endif CATEGORIES= games Modified: head/games/openbor/files/patch-source_ramlib_ram.c ============================================================================== --- head/games/openbor/files/patch-source_ramlib_ram.c Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor/files/patch-source_ramlib_ram.c Sun Aug 11 22:24:49 2019 (r508689) @@ -59,8 +59,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((vms.v_free_count + vms.v_inactive_count -+ + vms.v_cache_count) * getpagesize()) / byte_size; ++ return (u64)(vms.v_free_count + vms.v_inactive_count ++ + vms.v_cache_count) * getpagesize() / byte_size; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0; + size_t sz = sizeof(u_int); @@ -70,8 +70,8 @@ Implement Linux-like memory stats for BSDs + &v_inactive_count, &sz, NULL, 0); + sysctlbyname("vm.stats.vm.v_cache_count", + &v_cache_count, &sz, NULL, 0); -+ return (u64)((v_free_count + v_inactive_count + v_cache_count) -+ * getpagesize()) / byte_size; ++ return (u64)(v_free_count + v_inactive_count ++ + v_cache_count) * getpagesize() / byte_size; +#elif defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__NetBSD__) +#undef VM_UVMEXP @@ -92,8 +92,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages -+ + uvmexp.execpages) * uvmexp.pagesize) / byte_size; ++ return (u64)(uvmexp.free + uvmexp.inactive + uvmexp.filepages ++ + uvmexp.execpages) * uvmexp.pagesize / byte_size; #elif LINUX struct sysinfo info; sysinfo(&info); Modified: head/games/openbor3482/Makefile ============================================================================== --- head/games/openbor3482/Makefile Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor3482/Makefile Sun Aug 11 22:24:49 2019 (r508689) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTVERSION= 3482 -PORTREVISION= 1 +PORTREVISION= 2 PKGNAMESUFFIX= ${PORTVERSION} MASTERDIR= ${.CURDIR}/../openbor Modified: head/games/openbor3482/files/patch-source_ramlib_ram.c ============================================================================== --- head/games/openbor3482/files/patch-source_ramlib_ram.c Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor3482/files/patch-source_ramlib_ram.c Sun Aug 11 22:24:49 2019 (r508689) @@ -82,8 +82,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((vms.v_free_count + vms.v_inactive_count -+ + vms.v_cache_count) * getpagesize()) / byte_size; ++ return (u64)(vms.v_free_count + vms.v_inactive_count ++ + vms.v_cache_count) * getpagesize() / byte_size; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0; + size_t sz = sizeof(u_int); @@ -93,8 +93,8 @@ Implement Linux-like memory stats for BSDs + &v_inactive_count, &sz, NULL, 0); + sysctlbyname("vm.stats.vm.v_cache_count", + &v_cache_count, &sz, NULL, 0); -+ return (u64)((v_free_count + v_inactive_count + v_cache_count) -+ * getpagesize()) / byte_size; ++ return (u64)(v_free_count + v_inactive_count ++ + v_cache_count) * getpagesize() / byte_size; +#elif defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__NetBSD__) +#undef VM_UVMEXP @@ -115,8 +115,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages -+ + uvmexp.execpages) * uvmexp.pagesize) / byte_size; ++ return (u64)(uvmexp.free + uvmexp.inactive + uvmexp.filepages ++ + uvmexp.execpages) * uvmexp.pagesize / byte_size; #elif LINUX struct sysinfo info; sysinfo(&info); Modified: head/games/openbor3711/Makefile ============================================================================== --- head/games/openbor3711/Makefile Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor3711/Makefile Sun Aug 11 22:24:49 2019 (r508689) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTVERSION= 3711 -PORTREVISION= 1 +PORTREVISION= 2 PKGNAMESUFFIX= ${PORTVERSION} MASTERDIR= ${.CURDIR}/../openbor Modified: head/games/openbor3979/Makefile ============================================================================== --- head/games/openbor3979/Makefile Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor3979/Makefile Sun Aug 11 22:24:49 2019 (r508689) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTVERSION= 3979 -PORTREVISION= 1 +PORTREVISION= 2 PKGNAMESUFFIX= ${PORTVERSION} MASTERDIR= ${.CURDIR}/../openbor Modified: head/games/openbor3979/files/patch-source_ramlib_ram.c ============================================================================== --- head/games/openbor3979/files/patch-source_ramlib_ram.c Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor3979/files/patch-source_ramlib_ram.c Sun Aug 11 22:24:49 2019 (r508689) @@ -82,8 +82,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((vms.v_free_count + vms.v_inactive_count -+ + vms.v_cache_count) * getpagesize()) / byte_size; ++ return (u64)(vms.v_free_count + vms.v_inactive_count ++ + vms.v_cache_count) * getpagesize() / byte_size; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0; + size_t sz = sizeof(u_int); @@ -93,8 +93,8 @@ Implement Linux-like memory stats for BSDs + &v_inactive_count, &sz, NULL, 0); + sysctlbyname("vm.stats.vm.v_cache_count", + &v_cache_count, &sz, NULL, 0); -+ return (u64)((v_free_count + v_inactive_count + v_cache_count) -+ * getpagesize()) / byte_size; ++ return (u64)(v_free_count + v_inactive_count ++ + v_cache_count) * getpagesize() / byte_size; +#elif defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__NetBSD__) +#undef VM_UVMEXP @@ -115,8 +115,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages -+ + uvmexp.execpages) * uvmexp.pagesize) / byte_size; ++ return (u64)(uvmexp.free + uvmexp.inactive + uvmexp.filepages ++ + uvmexp.execpages) * uvmexp.pagesize / byte_size; #elif LINUX struct sysinfo info; sysinfo(&info); Modified: head/games/openbor4432/Makefile ============================================================================== --- head/games/openbor4432/Makefile Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor4432/Makefile Sun Aug 11 22:24:49 2019 (r508689) @@ -1,7 +1,7 @@ # $FreeBSD$ PORTVERSION= 4432 -PORTREVISION= 2 +PORTREVISION= 3 PKGNAMESUFFIX= ${PORTVERSION} MASTERDIR= ${.CURDIR}/../openbor Modified: head/games/openbor4432/files/patch-source_ramlib_ram.c ============================================================================== --- head/games/openbor4432/files/patch-source_ramlib_ram.c Sun Aug 11 22:15:14 2019 (r508688) +++ head/games/openbor4432/files/patch-source_ramlib_ram.c Sun Aug 11 22:24:49 2019 (r508689) @@ -59,8 +59,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((vms.v_free_count + vms.v_inactive_count -+ + vms.v_cache_count) * getpagesize()) / byte_size; ++ return (u64)(vms.v_free_count + vms.v_inactive_count ++ + vms.v_cache_count) * getpagesize() / byte_size; +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + u_int v_free_count = 0, v_inactive_count = 0, v_cache_count = 0; + size_t sz = sizeof(u_int); @@ -70,8 +70,8 @@ Implement Linux-like memory stats for BSDs + &v_inactive_count, &sz, NULL, 0); + sysctlbyname("vm.stats.vm.v_cache_count", + &v_cache_count, &sz, NULL, 0); -+ return (u64)((v_free_count + v_inactive_count + v_cache_count) -+ * getpagesize()) / byte_size; ++ return (u64)(v_free_count + v_inactive_count ++ + v_cache_count) * getpagesize() / byte_size; +#elif defined(__NetBSD__) || defined(__OpenBSD__) +# if defined(__NetBSD__) +#undef VM_UVMEXP @@ -92,8 +92,8 @@ Implement Linux-like memory stats for BSDs + { + return 0; + } -+ return (u64)((uvmexp.free + uvmexp.inactive + uvmexp.filepages -+ + uvmexp.execpages) * uvmexp.pagesize) / byte_size; ++ return (u64)(uvmexp.free + uvmexp.inactive + uvmexp.filepages ++ + uvmexp.execpages) * uvmexp.pagesize / byte_size; #elif LINUX struct sysinfo info; sysinfo(&info);