public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applied] writer: escape enum linkage name in abixml
@ 2021-09-08 14:23 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2021-09-08 14:23 UTC (permalink / raw)
  To: libabigail

Hello,

While looking at something else, I stumbled across this bug where the
linkage name of enum are not escaped in abixml.  So "forbidden"
characters like '<' can snick in.

Fixed thus.

This helps address https://bugzilla.redhat.com/show_bug.cgi?id=1951501

	* src/abg-writer.cc (write_enum_type_decl): Escape linkage name.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to master.

---
 src/abg-writer.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/abg-writer.cc b/src/abg-writer.cc
index 9f48dc92..f18293dc 100644
--- a/src/abg-writer.cc
+++ b/src/abg-writer.cc
@@ -3011,7 +3011,9 @@ write_enum_type_decl(const enum_type_decl_sptr& decl,
   write_is_non_reachable(is_type(decl), o);
 
   if (!decl->get_linkage_name().empty())
-    o << " linkage-name='" << decl->get_linkage_name() << "'";
+    o << " linkage-name='"
+      << xml::escape_xml_string(decl->get_linkage_name())
+      << "'";
 
   write_location(decl, ctxt);
   write_is_declaration_only(decl, o);
-- 
2.30.0


-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-08 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 14:23 [PATCH, applied] writer: escape enum linkage name in abixml Dodji Seketeli

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