From 3f878c6ce783f07e5acb4d3adc75edff6fa79c1c Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Tue, 31 Jan 2006 03:52:48 +0100 Subject: [PATCH] BOOKMARKS: Fix XBEL calling add_bookmark() with NULL title It didn't check that both title and title->text was non NULL. In either case it now passes "No title" string to add_bookmark(). Reported by Neuromancer. Tested with both: --- src/bookmarks/backend/xbel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bookmarks/backend/xbel.c b/src/bookmarks/backend/xbel.c index 114ddc1a1..69eed05ba 100644 --- a/src/bookmarks/backend/xbel.c +++ b/src/bookmarks/backend/xbel.c @@ -386,7 +386,7 @@ xbeltree_to_bookmarks_list(struct tree_node *node, tmp = add_bookmark(current_parent, 0, /* The element is optional */ - title ? title->text + title && title->text ? title->text : (unsigned char *) gettext("No title"), /* XXX: The href attribute isn't optional but * we don't validate the source XML yet, so @@ -407,7 +407,7 @@ xbeltree_to_bookmarks_list(struct tree_node *node, title = get_child(node, "title"); tmp = add_bookmark(current_parent, 0, - title ? title->text + title && title->text ? title->text : (unsigned char *) gettext("No title"), NULL);