- Prevent crash on systems with more than 601 sensors.

Add freeipmi-max-sensor.patch

OBS-URL: https://build.opensuse.org/package/show/systemsmanagement/freeipmi?expand=0&rev=36
This commit is contained in:
Klaus Kämpf 2013-12-19 14:04:25 +00:00 committed by Git OBS Bridge
parent 76102d6dda
commit e5879c76fb
3 changed files with 45 additions and 0 deletions

36
freeipmi-max-sensor.patch Normal file
View File

@ -0,0 +1,36 @@
2013-12-19 Dave Love <fx@gnu.org>
* ipmi-sensors/ipmi-sensors.c (_calculate_record_ids): Check
record numbr against array length.
* common/toolcommon/tool-sensor-common.h (MAX_SENSOR_RECORD_IDS):
Increase to 1024.
--- freeipmi-1.3.4/common/toolcommon/tool-sensor-common.h.orig 2013-04-26 18:01:55.000000000 +0100
+++ freeipmi-1.3.4/common/toolcommon/tool-sensor-common.h 2013-12-19 11:38:38.061632119 +0000
@@ -55,7 +55,7 @@
#define MAX_SENSOR_TYPES 256
#else /* !0 */
/* achu: pick more reasonable limits than the theoretical maxes */
-#define MAX_SENSOR_RECORD_IDS 512
+#define MAX_SENSOR_RECORD_IDS 1024
#define MAX_SENSOR_TYPES 64
#endif /* !0 */
#endif /* !__CYGWIN__ */
--- freeipmi-1.3.4/ipmi-sensors/ipmi-sensors.c.orig 2013-05-08 18:09:34.000000000 +0100
+++ freeipmi-1.3.4/ipmi-sensors/ipmi-sensors.c 2013-12-19 11:38:54.132859006 +0000
@@ -514,6 +514,13 @@
}
output_record_ids[(*output_record_ids_length)] = record_id;
+ if (output_record_ids_length >= MAX_SENSOR_RECORD_IDS)
+ {
+ fprintf (stderr,
+ "Too many sensors; limit is %d\n",
+ MAX_SENSOR_RECORD_IDS - 1);
+ return (-1);
+ }
(*output_record_ids_length)++;
}
}

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Dec 19 14:01:05 UTC 2013 - kkaempf@suse.com
- Prevent crash on systems with more than 601 sensors.
Add freeipmi-max-sensor.patch
-------------------------------------------------------------------
Fri Dec 13 07:31:45 UTC 2013 - kkaempf@suse.com

View File

@ -35,6 +35,8 @@ Source0: %{name}-%{version}.tar.bz2
Source1: bmc-watchdog.service
Source2: ipmidetectd.service
Source3: ipmiseld.service
# PATCH-FIX-UPSTREAM, Prevent crash on systems with more than 601 sensors, kkaempf@suse.de
Patch: freeipmi-max-sensor.patch
Summary: FreeIPMI
License: GPL-3.0+
Group: System/Management
@ -112,6 +114,7 @@ This service detects and monitors IPMI nodes.
%prep
%setup -q
%patch -p1
%build
%if 0%{?suse_version} >= 1110