[libdbi] Update to version 0.8.4, fix memory leak

Tom Lane tgl at fedoraproject.org
Sun Jul 22 23:51:31 UTC 2012


commit 2752a79b7428a3a5e479e12279fee9b9faa1323f
Author: Tom Lane <tgl at redhat.com>
Date:   Sun Jul 22 19:51:20 2012 -0400

    Update to version 0.8.4, fix memory leak

 .gitignore          |    2 +-
 libdbi-cflags.patch |    8 ++++----
 libdbi-leak.patch   |   16 ++++++++++++++++
 libdbi.spec         |   17 ++++++++++++-----
 sources             |    2 +-
 5 files changed, 34 insertions(+), 11 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b1c04b4..900e35a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-libdbi-0.8.3.tar.gz
+/libdbi-0.8.4.tar.gz
diff --git a/libdbi-cflags.patch b/libdbi-cflags.patch
index bea7565..3183bcf 100644
--- a/libdbi-cflags.patch
+++ b/libdbi-cflags.patch
@@ -3,10 +3,10 @@ upstream's idea of suitable optimization flags, per Fedora packaging
 guidelines, and we *don't* want -ffast-math, per bug #629964.
 
 
-diff -Naur libdbi-0.8.2.orig/configure.in libdbi-0.8.2/configure.in
---- libdbi-0.8.2.orig/configure.in	2007-02-14 17:51:02.000000000 -0500
-+++ libdbi-0.8.2/configure.in	2007-10-30 16:11:59.000000000 -0400
-@@ -55,7 +55,7 @@
+diff -Naur libdbi-0.8.4.orig/configure libdbi-0.8.4/configure
+--- libdbi-0.8.4.orig/configure	2010-08-31 19:22:52.000000000 -0400
++++ libdbi-0.8.4/configure	2012-07-22 19:43:23.073595685 -0400
+@@ -11203,7 +11203,7 @@
          case $host in
          *-*-linux*)
                  DEBUG="-g -Wall -D_REENTRANT -D__NO_MATH_INLINES -fsigned-char -std=gnu99"
diff --git a/libdbi-leak.patch b/libdbi-leak.patch
new file mode 100644
index 0000000..3555afd
--- /dev/null
+++ b/libdbi-leak.patch
@@ -0,0 +1,16 @@
+Fix an off-by-one error that results in duplicate row fetching and thus
+a memory leak, per bug #733413.
+
+
+diff -Naur libdbi-0.8.3.orig/src/dbi_result.c libdbi-0.8.3/src/dbi_result.c
+--- libdbi-0.8.3.orig/src/dbi_result.c	2008-01-23 11:37:36.000000000 -0500
++++ libdbi-0.8.3/src/dbi_result.c	2011-09-06 20:51:34.610449576 -0400
+@@ -1533,7 +1533,7 @@
+ }
+ 
+ static int _is_row_fetched(dbi_result_t *result, unsigned long long row) {
+-  if (!result->rows || (row >= result->numrows_matched)) return -1;
++  if (!result->rows || (row > result->numrows_matched)) return -1;
+   return !(result->rows[row] == NULL);
+ }
+ 
diff --git a/libdbi.spec b/libdbi.spec
index 744ab8e..711b1b1 100644
--- a/libdbi.spec
+++ b/libdbi.spec
@@ -1,16 +1,18 @@
 Summary: Database Independent Abstraction Layer for C
 Name: libdbi
-Version: 0.8.3
-Release: 6%{?dist}
+Version: 0.8.4
+Release: 1%{?dist}
 Group: Development/Libraries
 License: LGPLv2+
 URL: http://libdbi.sourceforge.net/
 
 Source: http://prdownloads.sourceforge.net/libdbi/%{name}-%{version}.tar.gz
+
 Patch1: libdbi-cflags.patch
+Patch2: libdbi-leak.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-BuildRequires: autoconf openjade docbook-style-dsssl
+BuildRequires: openjade docbook-style-dsssl
 Conflicts: libdbi-dbd-mysql < 0.8
 Conflicts: libdbi-dbd-pgsql < 0.8
 
@@ -40,8 +42,7 @@ needed to develop applications with libdbi.
 %setup -q -n %{name}-%{version}
 
 %patch1 -p1
-
-autoconf
+%patch2 -p1
 
 %build
 %configure
@@ -78,6 +79,12 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libdbi.la
 %{_libdir}/libdbi.so
 
 %changelog
+* Sun Jul 22 2012 Tom Lane <tgl at redhat.com> 0.8.4-1
+- Update to version 0.8.4 (seems to contain only configure-support updates,
+  but might as well adopt it)
+- Fix memory leak due to incorrect test in _is_row_fetched()
+Related: #733413
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.8.3-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/sources b/sources
index 7e90997..a976b6c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ca66db78d479cbfa727cf3245b5864ae  libdbi-0.8.3.tar.gz
+c5f15407ef7b07ba854cd8c9b15b88ff  libdbi-0.8.4.tar.gz


More information about the scm-commits mailing list