diff -Nru gparted-0.19.0/debian/changelog gparted-0.19.0/debian/changelog --- gparted-0.19.0/debian/changelog 2014-07-21 20:20:18.000000000 +0000 +++ gparted-0.19.0/debian/changelog 2014-11-09 21:45:29.000000000 +0000 @@ -1,8 +1,9 @@ -gparted (0.19.0-1build1) utopic; urgency=medium +gparted (0.19.0-2) unstable; urgency=medium - * Rebuild against libparted2. + * 03_fix-crash.patch: cherry pick of upstream commit that fixes + a crash caused by a cross thread write after free. - -- Colin Watson Mon, 21 Jul 2014 21:20:18 +0100 + -- Phillip Susi Sun, 09 Nov 2014 16:44:03 -0500 gparted (0.19.0-1) unstable; urgency=medium diff -Nru gparted-0.19.0/debian/patches/03_fix-crash.patch gparted-0.19.0/debian/patches/03_fix-crash.patch --- gparted-0.19.0/debian/patches/03_fix-crash.patch 1970-01-01 00:00:00.000000000 +0000 +++ gparted-0.19.0/debian/patches/03_fix-crash.patch 2014-11-09 21:43:16.000000000 +0000 @@ -0,0 +1,70 @@ +Author: Mike Fleetwood +Subject: Prevent cross thread write after free in _OnReadable() +Description: Cherry pick of upstream patch to fix crashes + and other errant behavior resulting from a cross thread + write that can happen after the memory was freed. + See upstream bug #731752 - Write after free cross thread race + in PipeCapture::_OnReadable() + +diff --git a/include/PipeCapture.h b/include/PipeCapture.h +index e37eba8..d3e2152 100644 +--- a/include/PipeCapture.h ++++ b/include/PipeCapture.h +@@ -31,7 +31,6 @@ class PipeCapture + Glib::ustring::size_type cursor ; + Glib::ustring::size_type lineend ; + Glib::RefPtr channel; +- guint sourceid; + bool OnReadable( Glib::IOCondition condition ); + static gboolean _OnReadable( GIOChannel *source, + GIOCondition condition, +diff --git a/src/PipeCapture.cc b/src/PipeCapture.cc +index bbb400e..2b5d5f8 100644 +--- a/src/PipeCapture.cc ++++ b/src/PipeCapture.cc +@@ -20,8 +20,7 @@ + namespace GParted { + + PipeCapture::PipeCapture( int fd, Glib::ustring &string ) : buff( string ), +- linestart( 0 ), cursor( 0 ), lineend( 0 ), +- sourceid( 0 ) ++ linestart( 0 ), cursor( 0 ), lineend( 0 ) + { + // tie fd to string + // make channel +@@ -31,10 +30,10 @@ PipeCapture::PipeCapture( int fd, Glib::ustring &string ) : buff( string ), + void PipeCapture::connect_signal() + { + // connect handler to signal input/output +- sourceid = g_io_add_watch( channel->gobj(), +- GIOCondition(G_IO_IN | G_IO_ERR | G_IO_HUP), +- _OnReadable, +- this ); ++ g_io_add_watch( channel->gobj(), ++ GIOCondition(G_IO_IN | G_IO_ERR | G_IO_HUP), ++ _OnReadable, ++ this ); + } + + gboolean PipeCapture::_OnReadable( GIOChannel *source, +@@ -43,8 +42,6 @@ gboolean PipeCapture::_OnReadable( GIOChannel *source, + { + PipeCapture *pc = static_cast(data); + gboolean rc = pc->OnReadable( Glib::IOCondition(condition) ); +- if (!rc) +- pc->sourceid = 0; + return rc; + } + +@@ -104,8 +101,6 @@ bool PipeCapture::OnReadable( Glib::IOCondition condition ) + + PipeCapture::~PipeCapture() + { +- if( sourceid > 0 ) +- g_source_remove( sourceid ); + } + + } // namespace GParted +-- +2.1.0 + diff -Nru gparted-0.19.0/debian/patches/series gparted-0.19.0/debian/patches/series --- gparted-0.19.0/debian/patches/series 2014-02-25 19:40:49.000000000 +0000 +++ gparted-0.19.0/debian/patches/series 2014-11-09 21:38:31.000000000 +0000 @@ -1,3 +1,4 @@ 01_fix-desktop.patch 02_use-pkexec.patch +03_fix-crash.patch