diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 62b5748a..95d033d7 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -592,7 +592,7 @@ write_location(const location& loc, ostream& o) loc.expand(filepath, line, column); - o << " filepath='" << filepath << "'" + o << " filepath='" << xml::escape_xml_string(filepath) << "'" << " line='" << line << "'" << " column='" << column << "'"; } @@ -620,7 +620,7 @@ write_location(const decl_base_sptr& decl, loc.expand(filepath, line, column); - o << " filepath='" << filepath << "'" + o << " filepath='" << xml::escape_xml_string(filepath) << "'" << " line='" << line << "'" << " column='" << column << "'"; } @@ -1210,7 +1210,7 @@ write_translation_unit(const translation_unit& tu, o << " address-size='" << static_cast(tu.get_address_size()) << "'"; if (!tu.get_path().empty()) - o << " path='" << tu.get_path() << "'"; + o << " path='" << xml::escape_xml_string(tu.get_path()) << "'"; if (tu.get_language() != translation_unit::LANG_UNKNOWN) o << " language='" @@ -3141,7 +3141,7 @@ write_corpus_to_native_xml(const corpus_sptr corpus, do_indent_to_level(ctxt, indent, 0); out << "get_path().empty()) - out << " path='" << corpus->get_path() << "'"; + out << " path='" << xml::escape_xml_string(corpus->get_path()) << "'"; if (!corpus->get_architecture_name().empty()) out << " architecture='" << corpus->get_architecture_name()<< "'"; diff --git a/tests/data/Makefile.am b/tests/data/Makefile.am index 0b9a1fe6..d7bbef20 100644 --- a/tests/data/Makefile.am +++ b/tests/data/Makefile.am @@ -318,6 +318,7 @@ test-types-stability/pr19139-DomainNeighborMapInst.o \ test-types-stability/pr19202-libmpi_gpfs.so.5.0 \ test-types-stability/pr19026-libvtkIOSQL-6.1.so.1 \ test-types-stability/pr19138-elf0 \ +test-types-stability/pr19433-custom0 \ \ test-diff-filter/test0-v0.cc \ test-diff-filter/test0-v1.cc \ diff --git a/tests/data/test-types-stability/pr19433-custom0 b/tests/data/test-types-stability/pr19433-custom0 new file mode 100755 index 00000000..16c90582 Binary files /dev/null and b/tests/data/test-types-stability/pr19433-custom0 differ diff --git a/tests/test-types-stability.cc b/tests/test-types-stability.cc index 7a75fb8c..101bf873 100644 --- a/tests/test-types-stability.cc +++ b/tests/test-types-stability.cc @@ -57,6 +57,7 @@ const char* elf_paths[] = "data/test-types-stability/pr19202-libmpi_gpfs.so.5.0", "data/test-types-stability/pr19026-libvtkIOSQL-6.1.so.1", "data/test-types-stability/pr19138-elf0", + "data/test-types-stability/pr19433-custom0", // The below should always be the last element of array. 0 };