Add patch to fix crash w/long error strings (upstream changesets 929 and

935)
This commit is contained in:
Jarod Wilson 2007-01-02 17:06:52 +00:00
parent be327538df
commit a8864c48c1
2 changed files with 42 additions and 1 deletions

View 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;
}

View File

@ -7,7 +7,7 @@
Summary: Round Robin Database Tool to store and display time-series data
Name: rrdtool
Version: 1.2.15
Release: 8%{?dist}
Release: 9%{?dist}
License: GPL
Group: Applications/Databases
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
Patch1: rrdtool-1.2.15-initrrdtool.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)
BuildRequires: gcc-c++, openssl-devel, freetype-devel
BuildRequires: libpng-devel, zlib-devel, libart_lgpl-devel >= 2.0
@ -114,6 +115,7 @@ The %{name}-tcl package includes RRDtool bindings for Tcl.
%endif
%patch1 -p1 -b .initrrdtool
%patch2 -p1 -b .leak
%patch3 -p1 -b .longstring
# 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' \
@ -272,6 +274,10 @@ find examples/ -type f -exec chmod 0644 {} \;
%endif
%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
- Fix for log grid memory leak (#201241)