public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Pavel Zhukov <pavel@zhukoff.net>
To: libabigail@sourceware.org
Cc: Pavel Zhukov <pavel.zhukov@huawei.com>, pavel@zhukoff.net
Subject: [PATCH] Escape the value of the symbols name attribute
Date: Tue, 11 Jan 2022 14:10:14 +0100	[thread overview]
Message-ID: <20220111131014.25278-1-pavel@zhukoff.net> (raw)

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(-)

diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 76ce809b..e2239e01 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -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() << "'";
 
-- 
2.34.1


             reply	other threads:[~2022-01-11 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11 13:10 Pavel Zhukov [this message]
2022-01-11 13:21 Pavel Zhukov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220111131014.25278-1-pavel@zhukoff.net \
    --to=pavel@zhukoff.net \
    --cc=libabigail@sourceware.org \
    --cc=pavel.zhukov@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).