Escape the value of the symbols name attribute
Commit Message
From: Pavel Zhukov <pavel.zhukov@huawei.com>
Symbols name may include < and > characters (go-runtime is an example)
which causes xml parsers to fail.
Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com>
---
src/abg-writer.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -3111,7 +3111,7 @@ write_elf_symbol(const elf_symbol_sptr& sym,
annotate(sym, ctxt, indent);
do_indent(o, indent);
- o << "<elf-symbol name='" << sym->get_name() << "'";
+ o << "<elf-symbol name='" << xml::escape_xml_string(sym->get_name()) << "'";
if (sym->is_variable() && sym->get_size())
o << " size='" << sym->get_size() << "'";