Add patch to fix crash w/long error strings (upstream changesets 929 and
935)
This commit is contained in:
parent
be327538df
commit
a8864c48c1
35
rrdtool-1.2.15-long_error_string.patch
Normal file
35
rrdtool-1.2.15-long_error_string.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
Index: rrdtool/src/rrd_not_thread_safe.c
|
||||||
|
===================================================================
|
||||||
|
--- rrdtool/src/rrd_not_thread_safe.c (revision 860)
|
||||||
|
+++ rrdtool/src/rrd_not_thread_safe.c (revision 935)
|
||||||
|
@@ -15,18 +15,24 @@
|
||||||
|
#define ERRBUFLEN 256
|
||||||
|
|
||||||
|
-static char rrd_error[MAXLEN] = "\0";
|
||||||
|
-static char rrd_liberror[ERRBUFLEN] = "\0";
|
||||||
|
+static char rrd_error[MAXLEN+10];
|
||||||
|
+static char rrd_liberror[ERRBUFLEN+10];
|
||||||
|
+static int rrd_context_init = 0;
|
||||||
|
/* The global context is very useful in the transition period to even
|
||||||
|
more thread-safe stuff, it can be used whereever we need a context
|
||||||
|
and do not need to worry about concurrency. */
|
||||||
|
static struct rrd_context global_ctx = {
|
||||||
|
- sizeof(rrd_error),
|
||||||
|
- sizeof(rrd_liberror),
|
||||||
|
+ MAXLEN,
|
||||||
|
+ ERRBUFLEN,
|
||||||
|
rrd_error,
|
||||||
|
rrd_liberror
|
||||||
|
};
|
||||||
|
-#include <stdarg.h>
|
||||||
|
+/* #include <stdarg.h> */
|
||||||
|
|
||||||
|
-struct rrd_context *rrd_get_context() {
|
||||||
|
+struct rrd_context *rrd_get_context(void) {
|
||||||
|
+ if (! rrd_context_init ){
|
||||||
|
+ rrd_context_init = 1;
|
||||||
|
+ global_ctx.rrd_error[0]='\0';
|
||||||
|
+ global_ctx.lib_errstr[0]='\0';
|
||||||
|
+ }
|
||||||
|
return &global_ctx;
|
||||||
|
}
|
@ -7,7 +7,7 @@
|
|||||||
Summary: Round Robin Database Tool to store and display time-series data
|
Summary: Round Robin Database Tool to store and display time-series data
|
||||||
Name: rrdtool
|
Name: rrdtool
|
||||||
Version: 1.2.15
|
Version: 1.2.15
|
||||||
Release: 8%{?dist}
|
Release: 9%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: Applications/Databases
|
Group: Applications/Databases
|
||||||
URL: http://people.ee.ethz.ch/~oetiker/webtools/%{name}/
|
URL: http://people.ee.ethz.ch/~oetiker/webtools/%{name}/
|
||||||
@ -16,6 +16,7 @@ Source1: php4-svn%{php_rrd_svn}.tar.gz
|
|||||||
Patch0: rrdtool-1.2.13-php.patch
|
Patch0: rrdtool-1.2.13-php.patch
|
||||||
Patch1: rrdtool-1.2.15-initrrdtool.patch
|
Patch1: rrdtool-1.2.15-initrrdtool.patch
|
||||||
Patch2: rrdtool-1.2.15-log_grid_leak.patch
|
Patch2: rrdtool-1.2.15-log_grid_leak.patch
|
||||||
|
Patch3: rrdtool-1.2.15-long_error_string.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
BuildRequires: gcc-c++, openssl-devel, freetype-devel
|
BuildRequires: gcc-c++, openssl-devel, freetype-devel
|
||||||
BuildRequires: libpng-devel, zlib-devel, libart_lgpl-devel >= 2.0
|
BuildRequires: libpng-devel, zlib-devel, libart_lgpl-devel >= 2.0
|
||||||
@ -114,6 +115,7 @@ The %{name}-tcl package includes RRDtool bindings for Tcl.
|
|||||||
%endif
|
%endif
|
||||||
%patch1 -p1 -b .initrrdtool
|
%patch1 -p1 -b .initrrdtool
|
||||||
%patch2 -p1 -b .leak
|
%patch2 -p1 -b .leak
|
||||||
|
%patch3 -p1 -b .longstring
|
||||||
|
|
||||||
# Fix to find correct python dir on lib64
|
# Fix to find correct python dir on lib64
|
||||||
%{__perl} -pi -e 's|get_python_lib\(0,0,prefix|get_python_lib\(1,0,prefix|g' \
|
%{__perl} -pi -e 's|get_python_lib\(0,0,prefix|get_python_lib\(1,0,prefix|g' \
|
||||||
@ -272,6 +274,10 @@ find examples/ -type f -exec chmod 0644 {} \;
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jan 02 2007 Jarod Wilson <jwilson@redhat.com> 1.2.15-9
|
||||||
|
- Fix crash with long error strings (upstream
|
||||||
|
changesets 929 and 935)
|
||||||
|
|
||||||
* Thu Dec 14 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-8
|
* Thu Dec 14 2006 Jarod Wilson <jwilson@redhat.com> 1.2.15-8
|
||||||
- Fix for log grid memory leak (#201241)
|
- Fix for log grid memory leak (#201241)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user