diff --git a/client.c b/client.c index c0df7a7e7..ff859c3dc 100644 --- a/client.c +++ b/client.c @@ -768,7 +768,7 @@ client_markup_on_elem(markup_parser_data_t *p, const char *elem, const char **names, const char **values) { assert(!a_strcmp(elem, "title")); - buffer_add_xmlescaped(&p->text, p->priv); + buffer_add_xmlescaped(&p->text, NONULL(p->priv)); } /** Parse a markup string which contains special markup sequence relative to a diff --git a/common/markup.c b/common/markup.c index 9de51f68f..e34c585a7 100644 --- a/common/markup.c +++ b/common/markup.c @@ -113,8 +113,10 @@ markup_parse_text(GMarkupParseContext *context __attribute__ ((unused)), { markup_parser_data_t *p = (markup_parser_data_t *) user_data; - buffer_grow(&p->text, text_len); - buffer_add_xmlescaped(&p->text, text); + if (text_len) { + buffer_grow(&p->text, text_len); + buffer_add_xmlescaped(&p->text, text); + } } /** Create a markup_parser_data_t structure with elements list. diff --git a/widgets/taglist.c b/widgets/taglist.c index f7c5ef242..e883cd7cc 100644 --- a/widgets/taglist.c +++ b/widgets/taglist.c @@ -60,7 +60,7 @@ tag_markup_on_elem(markup_parser_data_t *p, const char *elem, const char **names, const char **values) { assert(!a_strcmp(elem, "title")); - buffer_add_xmlescaped(&p->text, p->priv); + buffer_add_xmlescaped(&p->text, NONULL(p->priv)); }