[python-gudev/f15] Fix memory corruption when calling query_by_subsystem

Stanislav Ochotnicky sochotni at fedoraproject.org
Thu Jul 21 08:11:31 UTC 2011


commit 06ed21b9c4f24dce1561689de08b1609237a0bac
Author: Stanislav Ochotnicky <sochotnicky at redhat.com>
Date:   Thu Jul 21 09:56:01 2011 +0200

    Fix memory corruption when calling query_by_subsystem
    
    - Resolves: rhbz#637084,rhbz#723795
    - Related: rhbz#631789
    
    Conflicts:
    
    	python-gudev.spec

 ...hen-freeing-result-of-g_udev_client_query.patch |   49 ++++++++++++++++++++
 python-gudev.spec                                  |   13 +++++-
 2 files changed, 61 insertions(+), 1 deletions(-)
---
diff --git a/0001-Fix-crash-when-freeing-result-of-g_udev_client_query.patch b/0001-Fix-crash-when-freeing-result-of-g_udev_client_query.patch
new file mode 100644
index 0000000..485a9b9
--- /dev/null
+++ b/0001-Fix-crash-when-freeing-result-of-g_udev_client_query.patch
@@ -0,0 +1,49 @@
+From 0f946dc55d15463e451ac9784ab50fffef7ad521 Mon Sep 17 00:00:00 2001
+From: Sam Morris <sam at robots.org.uk>
+Date: Sat, 19 Jun 2010 16:44:24 +0100
+Subject: [PATCH 1/4] Fix crash when freeing result of g_udev_client_query_by_subsystem.
+
+g_udev_client_query_by_subsystem returns a GList*, not a GSList*.
+---
+ gudev.override |   10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gudev.override b/gudev.override
+index 6595da3..b7e51f5 100644
+--- a/gudev.override
++++ b/gudev.override
+@@ -7,9 +7,9 @@ headers
+ 
+ /* Helper functions from gnome-python (gtksourceview) */
+ static PyObject *
+-gslist_to_pylist_objs (const GSList *source)
++glist_to_pylist_objs (const GList *source)
+ {
+-    const GSList *iter;
++    const GList *iter;
+     PyObject *dest = PyList_New (0);
+     for (iter = source; iter != NULL; iter = iter->next)
+     {
+@@ -144,7 +144,7 @@ _wrap_g_udev_client_query_by_subsystem (PyGObject *self, PyObject *args, PyObjec
+ {
+     static char *kwlist[] = { "subsystem", NULL };
+     gchar *subsystem = NULL;
+-    GSList *source;
++    GList *source;
+     PyObject *dest;
+ 
+     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|z:GUdevClient.query_by_subsystem",
+@@ -152,8 +152,8 @@ _wrap_g_udev_client_query_by_subsystem (PyGObject *self, PyObject *args, PyObjec
+         return NULL;
+ 
+     source = g_udev_client_query_by_subsystem(G_UDEV_CLIENT(self->obj), subsystem);
+-    dest = gslist_to_pylist_objs(source);
+-    g_slist_free(source);
++    dest = glist_to_pylist_objs(source);
++    g_list_free(source);
+     return dest;
+ }
+ %%
+-- 
+1.7.2.2
+
diff --git a/python-gudev.spec b/python-gudev.spec
index c494402..048f430 100644
--- a/python-gudev.spec
+++ b/python-gudev.spec
@@ -12,8 +12,11 @@ URL:            http://github.com/nzjrs/python-gudev
 # Tar.gz can be downloaded from
 # http://github.com/nzjrs/python-gudev/tarball/%{version}
 Source0:        %{srcname}.tar.gz
+
+# patch from upstream
+Patch0:         0001-Fix-crash-when-freeing-result-of-g_udev_client_query.patch
 Version:        147.1
-Release:        6%{?dist}
+Release:        7%{?dist}
 Group:          Development/Libraries
 License:        LGPLv3+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -31,6 +34,9 @@ python-gudev is a Python (PyGObject) binding to the GUDev UDEV library.
 %prep
 %setup -q -n %{srcname}
 
+# override fuzzy to 1 so that patch can be applied
+%patch0 -F1 -p1
+
 %build
 sh autogen.sh --prefix %{_prefix} --disable-static
 make %{?_smp_mflags} CFLAGS="%{optflags}"
@@ -55,6 +61,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/*
 
 %changelog
+* Thu Jul 21 2011 Stanislav Ochotnicky <sochotnicky at redhat.com> - 147.1-7
+- Added upstream patch
+- Resolves: rhbz#637084,rhbz#723795
+- Related: rhbz#631789
+
 * Tue Feb 08 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 147.1-6
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list