FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 02-20-2009, 02:45 PM
Hans de Goede
 
Default PATCH: pyparted: Do not keep a borrowed refence without INCREF-ing it

In _ped_Disk_init we store a borrowed reference in self->dev (through
PyArg_ParseTuple()). We INCREF this on success at the end. But we keep it
without INCREF-ing it in an error path. This path clears the borrowed reference
in the error path. This fixes various cases of python crashing when having
an invalid partition table.
---
src/pydisk.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/pydisk.c b/src/pydisk.c
index 27b8d95..19f7724 100644
--- a/src/pydisk.c
+++ b/src/pydisk.c
@@ -273,6 +273,7 @@ int _ped_Disk_init(_ped_Disk *self, PyObject *args,
PyObject *kwds) {
PyErr_Format(IOException, "Failed to read partition table from
device %s", device->path);

}

+ self->dev = NULL;
return -4;
}

--
1.6.1.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:48 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org