Bug#659061: brasero: segfaults when creating a subfolder

Jan Hauke Rahm jhr at debian.org
Mon Feb 13 20:10:26 UTC 2012


On Tue, Feb 07, 2012 at 10:43:15PM +0100, Simon Wenner wrote:
> 1. Create a data project
> 2. Add a folder with some files in it
> 3. Select a file inside this folder
> 4. Press on the "new folder" button
> 5. Enter a name and hit enter
> 6. Segfault

I just tried to figure out the issue here. It seems, as long as

BraseroFileNode * brasero_file_node_new_empty_folder (const gchar *name);

sets node->is_fake = TRUE, it won't be so easy to bypass this.

Background:
A node that is to be renamed, removed, or used as parent (i.e. you try
to move a file into the newly created dir), needs an URI. Those are
received by brasero_data_project_node_to_uri() of which the return value
isn't checked (in neither of the above mentioned cases IIRC). Given a
node that has is_fake set, the function returns NULL, though. Trying to
create a hash (by using g_str_hash() from glib2) will thus lead to a
segfault (dereferencing NULL).

Obviously, one could just check return values and circumvent the part
that uses the URI. This makes renaming work (which is what the bug
reporter experienced not to work) as well as removing. You can't move
anything into a fake dir, though. At least I didn't figure out how that
would be possible (or make sense anyways). And suddenly, a new directory
isn't worth much. :)

Maybe this helps someone who knows the code better than me to get into
the problem more easily.

Hauke

-- 
 .''`.   Jan Hauke Rahm <jhr at debian.org>               www.jhr-online.de
: :'  :  Debian Developer                                 www.debian.org
`. `'`   Member of the Linux Foundation                    www.linux.com
  `-     Fellow of the Free Software Foundation Europe      www.fsfe.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20120213/827d836c/attachment.pgp>


More information about the pkg-gnome-maintainers mailing list