Be more on the safe side.
it's useless to escape anything if text_len is 0, also some clients seem to have a NULL name, so use NONULL(p->priv). Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
parent
0b93318836
commit
17744fc81d
2
client.c
2
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
|
||||
|
|
|
@ -113,8 +113,10 @@ markup_parse_text(GMarkupParseContext *context __attribute__ ((unused)),
|
|||
{
|
||||
markup_parser_data_t *p = (markup_parser_data_t *) user_data;
|
||||
|
||||
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.
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue