[cmake-developers] CTest XML outputs unsafe content

Mathieu MARACHE mathieu.marache at gmail.com
Thu Aug 27 07:20:31 EDT 2015


Hi there,

I'm maintaining a CTest output parser for Bamboo. It was reported to me
that CMake 3.3.1 produced parsing issues in my plugin. After digging into
CMake source code, it seems that a bug was introduced with the replacement
of direct use of cmXMLSafe and std::ostream in favor of cmXMLwriter.

cmXMLWriter is, I assume wrongly, output Safe content without (quotes,
etc.) escaping.

This simple modification corrects this to have pre-3.3 area behavior :

index c38c0de..7b71bae 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -94,12 +94,12 @@ private:

   static cmXMLSafe SafeContent(const char* value)
     {
-    return cmXMLSafe(value).Quotes(false);
+    return cmXMLSafe(value);
     }

   static cmXMLSafe SafeContent(std::string const& value)
     {
-    return cmXMLSafe(value).Quotes(false);
+    return cmXMLSafe(value);
     }

   template <typename T>

Regards,
--
nǝıɥʇɐƜ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150827/f60e552b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-escape-quotes.patch
Type: application/octet-stream
Size: 773 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150827/f60e552b/attachment.obj>


More information about the cmake-developers mailing list