aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2019-08-12 06:24:49 +0800
committerjbeich <jbeich@FreeBSD.org>2019-08-12 06:24:49 +0800
commitfba3d048beac74af8259626bb6b772ff895c61f0 (patch)
treeccb003aa4b990d81a0a209a0d800ae13df9cd591
parentc158996e15325c20496da90eae2a6e9108ec866a (diff)
downloadfreebsd-ports-gnome-fba3d048beac74af8259626bb6b772ff895c61f0.tar.gz
freebsd-ports-gnome-fba3d048beac74af8259626bb6b772ff895c61f0.tar.zst
freebsd-ports-gnome-fba3d048beac74af8259626bb6b772ff895c61f0.zip
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
-rw-r--r--games/openbor/Makefile2
-rw-r--r--games/openbor/files/patch-source_ramlib_ram.c12
-rw-r--r--games/openbor3482/Makefile2
-rw-r--r--games/openbor3482/files/patch-source_ramlib_ram.c12
-rw-r--r--games/openbor3711/Makefile2
-rw-r--r--games/openbor3979/Makefile2
-rw-r--r--games/openbor3979/files/patch-source_ramlib_ram.c12
-rw-r--r--games/openbor4432/Makefile2
-rw-r--r--games/openbor4432/files/patch-source_ramlib_ram.c12
9 files changed, 29 insertions, 29 deletions
diff --git a/games/openbor/Makefile b/games/openbor/Makefile
index 7c0f30d30857..a90c977de205 100644
--- a/games/openbor/Makefile
+++ b/games/openbor/Makefile
@@ -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
diff --git a/games/openbor/files/patch-source_ramlib_ram.c b/games/openbor/files/patch-source_ramlib_ram.c
index adcdf0d70f6f..9b5896dc1539 100644
--- a/games/openbor/files/patch-source_ramlib_ram.c
+++ b/games/openbor/files/patch-source_ramlib_ram.c
@@ -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);
diff --git a/games/openbor3482/Makefile b/games/openbor3482/Makefile
index 92a8ef30b4cb..553d748cf3de 100644
--- a/games/openbor3482/Makefile
+++ b/games/openbor3482/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTVERSION= 3482
-PORTREVISION= 1
+PORTREVISION= 2
PKGNAMESUFFIX= ${PORTVERSION}
MASTERDIR= ${.CURDIR}/../openbor
diff --git a/games/openbor3482/files/patch-source_ramlib_ram.c b/games/openbor3482/files/patch-source_ramlib_ram.c
index c1609f723ea0..4a5a760fc13a 100644
--- a/games/openbor3482/files/patch-source_ramlib_ram.c
+++ b/games/openbor3482/files/patch-source_ramlib_ram.c
@@ -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);
diff --git a/games/openbor3711/Makefile b/games/openbor3711/Makefile
index af248917d873..32de774c0237 100644
--- a/games/openbor3711/Makefile
+++ b/games/openbor3711/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTVERSION= 3711
-PORTREVISION= 1
+PORTREVISION= 2
PKGNAMESUFFIX= ${PORTVERSION}
MASTERDIR= ${.CURDIR}/../openbor
diff --git a/games/openbor3979/Makefile b/games/openbor3979/Makefile
index 058e6d7c0024..a5237b6f81b4 100644
--- a/games/openbor3979/Makefile
+++ b/games/openbor3979/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTVERSION= 3979
-PORTREVISION= 1
+PORTREVISION= 2
PKGNAMESUFFIX= ${PORTVERSION}
MASTERDIR= ${.CURDIR}/../openbor
diff --git a/games/openbor3979/files/patch-source_ramlib_ram.c b/games/openbor3979/files/patch-source_ramlib_ram.c
index 9485b7bd1906..eb06b6b133b7 100644
--- a/games/openbor3979/files/patch-source_ramlib_ram.c
+++ b/games/openbor3979/files/patch-source_ramlib_ram.c
@@ -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);
diff --git a/games/openbor4432/Makefile b/games/openbor4432/Makefile
index 213faa22da20..21f0cb9ecc37 100644
--- a/games/openbor4432/Makefile
+++ b/games/openbor4432/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
PORTVERSION= 4432
-PORTREVISION= 2
+PORTREVISION= 3
PKGNAMESUFFIX= ${PORTVERSION}
MASTERDIR= ${.CURDIR}/../openbor
diff --git a/games/openbor4432/files/patch-source_ramlib_ram.c b/games/openbor4432/files/patch-source_ramlib_ram.c
index c88e7fda3724..430384591fde 100644
--- a/games/openbor4432/files/patch-source_ramlib_ram.c
+++ b/games/openbor4432/files/patch-source_ramlib_ram.c
@@ -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);