1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

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:

	<bookmark href="empty://title"><title></title><bookmark>
	<bookmark href="no://title"></bookmark>
This commit is contained in:
Jonas Fonseca 2006-01-31 03:52:48 +01:00 committed by Jonas Fonseca
parent 1a394f7f28
commit 3f878c6ce7

View File

@ -386,7 +386,7 @@ xbeltree_to_bookmarks_list(struct tree_node *node,
tmp = add_bookmark(current_parent, 0,
/* The <title> 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);