Re: [PATCH] nautilus_file_get_gicon() shouldn't dereference NULL file



Am Mittwoch, den 27.02.2008, 16:10 +0100 schrieb Alexander Larsson:
> On Wed, 2008-02-27 at 15:59 +0100, Christian Neumair wrote:
> > Am Mittwoch, den 27.02.2008, 15:31 +0100 schrieb Alexander Larsson:
> > > Did you actually verify this crash?
> > > I'm not sure how file got NULL as it comes from a
> > > nautilus_file_get(location) call. But i guess location could be NULL. 
> > > 
> > > Anyway, it should be safe to commit. But are we sure it fixes the bug?
> > 
> > You are right, I could not verify/reproduce this crash. I verified and
> > agree that this should only happen in the location == NULL case.
> > 
> > In general, we're not very robust wrt broken user data ATM, missing
> > glade files or " " (two spaces) lines in bookmark files cause asserts to
> > fail. Also note that in Thread 1#1 of the BT, there is a line containing
> > 
> > "** Message: failed to load session
> > from /home/ron/.nautilus/saved-session-X"
> > 
> > so the user's data might be somewhat broken.
> 
> In fact the original ubuntu bug verifies this. That is the content of
> his .gtk-bookmarks file. We should probably avoid this crash earlier in
> the code.

I see. I'm also attaching a patch that makes the bookmark code ignore
lines beginning with ' '. Is it OK to commit this one as well?

best regards,
 Christian Neumair

-- 
Christian Neumair <cneumair gnome org>
Index: src/nautilus-bookmark-list.c
===================================================================
--- src/nautilus-bookmark-list.c	(Revision 13843)
+++ src/nautilus-bookmark-list.c	(Arbeitskopie)
@@ -453,7 +454,7 @@ nautilus_bookmark_list_load_file (Nautil
 
 		lines = g_strsplit (contents, "\n", -1);
       	 	for (i = 0; lines[i]; i++) {
-	  		if (lines[i][0]) {
+	  		if (lines[i][0] && lines[i][0] != ' ') {
 				/* gtk 2.7/2.8 might have labels appended to bookmarks which are separated by a space */
 				/* we must seperate the bookmark uri and the potential label */
  				char *space, *label;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]