projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dbf9f7a
)
Don't crash if set_app_info is called before adding metadata
author
William Jon McCann
<jmccann@redhat.com>
Fri, 24 Aug 2012 17:32:25 +0000
(13:32 -0400)
committer
William Jon McCann
<jmccann@redhat.com>
Fri, 24 Aug 2012 17:36:26 +0000
(13:36 -0400)
set_mime_type, set_is_private, add_group, set_groups, set_icon, etc
all added metadata before using it. If set_app_info was called before
any of those it would crash when trying to access the metadata.
glib/gbookmarkfile.c
patch
|
blob
|
history
diff --git
a/glib/gbookmarkfile.c
b/glib/gbookmarkfile.c
index
edf196b
..
f8c2756
100644
(file)
--- a/
glib/gbookmarkfile.c
+++ b/
glib/gbookmarkfile.c
@@
-3234,6
+3234,9
@@
g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
}
}
}
}
+ if (!item->metadata)
+ item->metadata = bookmark_metadata_new ();
+
ai = bookmark_item_lookup_app_info (item, name);
if (!ai)
{
ai = bookmark_item_lookup_app_info (item, name);
if (!ai)
{