aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/apachetop
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2004-02-27 07:44:04 +0800
committerkuriyama <kuriyama@FreeBSD.org>2004-02-27 07:44:04 +0800
commit50792f35ebb30494170eca66bcf78f9f9b7ed30e (patch)
treea31bcd95a3e162d6c58d74b819c504e51c2b2899 /sysutils/apachetop
parent48356721f7e3d5edd2fa40bf97117d20ee3743b8 (diff)
downloadfreebsd-ports-gnome-50792f35ebb30494170eca66bcf78f9f9b7ed30e.tar.gz
freebsd-ports-gnome-50792f35ebb30494170eca66bcf78f9f9b7ed30e.tar.zst
freebsd-ports-gnome-50792f35ebb30494170eca66bcf78f9f9b7ed30e.zip
o Add a patch to check calloc() size is zero or not before calling.
This fix dumping cores on recent environment. No response from: maintainer
Diffstat (limited to 'sysutils/apachetop')
-rw-r--r--sysutils/apachetop/Makefile2
-rw-r--r--sysutils/apachetop/files/patch-display.cc17
2 files changed, 18 insertions, 1 deletions
diff --git a/sysutils/apachetop/Makefile b/sysutils/apachetop/Makefile
index 2b15eaaa322e..dea5ec017a82 100644
--- a/sysutils/apachetop/Makefile
+++ b/sysutils/apachetop/Makefile
@@ -7,7 +7,7 @@
PORTNAME= apachetop
PORTVERSION= 0.9
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= http://clueful.shagged.org/apachetop/files/
DISTNAME= ${PORTNAME}-${PORTVERSION}
diff --git a/sysutils/apachetop/files/patch-display.cc b/sysutils/apachetop/files/patch-display.cc
new file mode 100644
index 000000000000..7d290b67173c
--- /dev/null
+++ b/sysutils/apachetop/files/patch-display.cc
@@ -0,0 +1,17 @@
+--- src/display.cc.orig Sun Feb 22 22:53:52 2004
++++ src/display.cc Sun Feb 22 22:54:16 2004
+@@ -238,8 +238,12 @@
+ * I'm fairly sure, realistically, it'll never get high enough to be
+ * a problem, so uInt should be ok */
+ if (items) free(items); /* get rid of the last one */
+- items = (struct itemlist *)
+- calloc((unsigned int)items_size, sizeof(itemlist));
++ if (items_size == 0) {
++ items = NULL;
++ } else {
++ items = (struct itemlist *)
++ calloc((unsigned int)items_size, sizeof(itemlist));
++ }
+
+ /* another thread may change the contents of cf while we're running,
+ * and it would be undesirable to have most of this change on us, so