r32567 - in /desktop/unstable/pygobject/debian: changelog patches/00git_pygspawn_error_check.patch patches/series

mpitt at users.alioth.debian.org mpitt at users.alioth.debian.org
Thu Feb 9 05:53:57 UTC 2012


Author: mpitt
Date: Thu Feb  9 05:53:56 2012
New Revision: 32567

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=32567
Log:
Add 00git_pygspawn_error_check.patch: Fix crash in pygspawn() when the
argv or envp arguments are not proper sequences. Backported from upstream
git head.

Added:
    desktop/unstable/pygobject/debian/patches/00git_pygspawn_error_check.patch
Modified:
    desktop/unstable/pygobject/debian/changelog
    desktop/unstable/pygobject/debian/patches/series

Modified: desktop/unstable/pygobject/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/changelog?rev=32567&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/changelog [utf-8] (original)
+++ desktop/unstable/pygobject/debian/changelog [utf-8] Thu Feb  9 05:53:56 2012
@@ -2,6 +2,9 @@
 
   * Add glib_2.30.patch: Partially revert commit ee62df4 to drop the usage of
     g_value_*_schar. This was introduced in glib 2.31 only. (Closes: #659184)
+  * Add 00git_pygspawn_error_check.patch: Fix crash in pygspawn() when the
+    argv or envp arguments are not proper sequences. Backported from upstream
+    git head.
 
  -- Martin Pitt <mpitt at debian.org>  Thu, 09 Feb 2012 06:47:36 +0100
 

Added: desktop/unstable/pygobject/debian/patches/00git_pygspawn_error_check.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/00git_pygspawn_error_check.patch?rev=32567&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/00git_pygspawn_error_check.patch (added)
+++ desktop/unstable/pygobject/debian/patches/00git_pygspawn_error_check.patch [utf-8] Thu Feb  9 05:53:56 2012
@@ -1,0 +1,45 @@
+From 945fd18e531c2131440af93dcd89f6c63abbfd7c Mon Sep 17 00:00:00 2001
+From: Ryan Lortie <desrt at desrt.ca>
+Date: Tue, 7 Feb 2012 13:42:19 -0500
+Subject: pygspawn: improve error checking
+
+gspawn 'argv' and 'envp' parameters expect sequences of strings.  This
+is enforced by checking that the passed argument is a sequence and that
+each item returned from it is a string.
+
+We do now, however, verify that each item can be successfully taken from
+the sequence.  'os.environ' is an example of an object that passes
+PySequence_Check() but fails to return objects from PySequence_ITEM().
+
+Add a simple NULL check to avoid the crash.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=669594
+---
+ gi/_glib/pygspawn.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gi/_glib/pygspawn.c b/gi/_glib/pygspawn.c
+index 309b83d..cfa5555 100644
+--- a/gi/_glib/pygspawn.c
++++ b/gi/_glib/pygspawn.c
+@@ -150,7 +150,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
+     argv = g_new0(char *, len + 1);
+     for (i = 0; i < len; ++i) {
+         PyObject *tmp = PySequence_ITEM(pyargv, i);
+-        if (!PYGLIB_PyUnicode_Check(tmp)) {
++        if (tmp == NULL || !PYGLIB_PyUnicode_Check(tmp)) {
+             PyErr_SetString(PyExc_TypeError,
+                             "gi._glib.spawn_async: "
+ 			    "first argument must be a sequence of strings");
+@@ -175,7 +175,7 @@ pyglib_spawn_async(PyObject *object, PyObject *args, PyObject *kwargs)
+         envp = g_new0(char *, len + 1);
+         for (i = 0; i < len; ++i) {
+             PyObject *tmp = PySequence_ITEM(pyenvp, i);
+-            if (!PYGLIB_PyUnicode_Check(tmp)) {
++            if (tmp == NULL || !PYGLIB_PyUnicode_Check(tmp)) {
+                 PyErr_SetString(PyExc_TypeError,
+                                 "gi._glib.spawn_async: "
+ 				"second argument must be a sequence of strings");
+-- 
+1.7.9
+

Modified: desktop/unstable/pygobject/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/series?rev=32567&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/patches/series [utf-8] (original)
+++ desktop/unstable/pygobject/debian/patches/series [utf-8] Thu Feb  9 05:53:56 2012
@@ -1,1 +1,2 @@
+00git_pygspawn_error_check.patch
 glib_2.30.patch




More information about the pkg-gnome-commits mailing list