[zabbix/f14] fix server crash (ZBX-4099)

Dan Horák sharkcz at fedoraproject.org
Sat Sep 10 08:25:48 UTC 2011


commit a648684145fc5a99cd76ddbb8b438ed130baf6b1
Author: Dan Horák <dan at danny.cz>
Date:   Fri Sep 9 12:54:14 2011 +0200

    fix server crash (ZBX-4099)

 zabbix-1.8.7-zbx4099.patch |   37 +++++++++++++++++++++++++++++++++++++
 zabbix.spec                |    8 +++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/zabbix-1.8.7-zbx4099.patch b/zabbix-1.8.7-zbx4099.patch
new file mode 100644
index 0000000..b82ede4
--- /dev/null
+++ b/zabbix-1.8.7-zbx4099.patch
@@ -0,0 +1,37 @@
+Index: src/libs/zbxdbhigh/db.c
+===================================================================
+--- src/libs/zbxdbhigh/db.c	(revision 21469)
++++ src/libs/zbxdbhigh/db.c	(revision 21470)
+@@ -2062,7 +2062,7 @@
+ 
+ 	h_value = zbx_malloc(h_value, (h_alloc + 1) * sizeof(char *));
+ 
+-	while (NULL != (row = DBfetch(result)))
++	while (NULL != (row = DBfetch(result)) && SUCCEED != DBis_null(row[0]))
+ 	{
+ 		if (h_alloc == h_num)
+ 		{
+Index: src/libs/zbxdb/db.c
+===================================================================
+--- src/libs/zbxdb/db.c	(revision 21469)
++++ src/libs/zbxdb/db.c	(revision 21470)
+@@ -1275,13 +1275,13 @@
+ 
+ int	zbx_db_is_null(const char *field)
+ {
+-	int	ret = FAIL;
+-
+-	if (NULL == field)		ret = SUCCEED;
+-#if defined(HAVE_ORACLE)
+-	else if ('\0' == field[0])	ret = SUCCEED;
++	if (NULL == field)
++		return SUCCEED;
++#ifdef HAVE_ORACLE
++	if ('\0' == *field)
++		return SUCCEED;
+ #endif
+-	return ret;
++	return FAIL;
+ }
+ 
+ #if defined(HAVE_IBM_DB2)
diff --git a/zabbix.spec b/zabbix.spec
index e17eff3..8ee9a01 100644
--- a/zabbix.spec
+++ b/zabbix.spec
@@ -7,7 +7,7 @@
 
 Name:           zabbix
 Version:        1.8.7
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -27,6 +27,8 @@ Source8:        zabbix_snmptrap.README
 Patch0:         zabbix-1.8.4-config.patch
 # local rules for config files - fonts
 Patch1:         zabbix-1.8.4-fonts-config.patch
+# https://support.zabbix.com/browse/ZBX-4099
+Patch2:         zabbix-1.8.7-zbx4099.patch
 
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -250,6 +252,7 @@ Zabbix web frontend for SQLite
 %prep
 %setup0 -q
 %patch0 -p1
+%patch2 -p0
 
 # DejaVu fonts doesn't exist on EL <= 5
 %if 0%{?fedora} || 0%{?rhel} >= 6
@@ -609,6 +612,9 @@ fi
 
 
 %changelog
+* Fri Sep  9 2011 Dan Horák <dan[at]danny.cz> - 1.8.7-2
+- fix server crash (ZBX-4099)
+
 * Mon Sep  5 2011 Dan Horák <dan[at]danny.cz> - 1.8.7-1
 - updated to 1.8.7
 - fix home dir for the zabbix user (#734496)


More information about the scm-commits mailing list