components/openscap/patches/oscap_acquire.c.patch
author Alan Coopersmith <Alan.Coopersmith@Oracle.COM>
Mon, 10 Oct 2016 13:26:21 -0700
changeset 7081 616e1d8621e7
parent 5985 6b195cad32d4
permissions -rw-r--r--
24824653 improve gobject-introspection typelib dependency tracking

This patch fixes issues with the report not working
when the SCE script output contains special characters.
This patch has not been submitted upstream but
will be by 2016-Jun-01.
--- openscap-1.2.6/src/common/oscap_acquire.c.~1~	2016-05-09 10:10:31.879607312 -0700
+++ openscap-1.2.6/src/common/oscap_acquire.c	2016-05-09 10:15:56.086122585 -0700
@@ -183,6 +183,15 @@
 			// & is a special case, we have to "escape" it manually
 			// (all else will eventually get handled by libxml)
 			oscap_string_append_string(pipe_string, "&amp;");
+                } else if (readbuf < 0x20 && !(readbuf == '\t' ||
+               readbuf == '\n' || readbuf == '\r')) {
+            // libxml doesn't tolerate most control characters
+            // in its input stream, reformat
+            char tranbuf[5];
+
+            snprintf(tranbuf, sizeof(tranbuf), "\\%03o", readbuf);
+            oscap_string_append_string(pipe_string, tranbuf);
+
 		} else {
 			oscap_string_append_char(pipe_string, readbuf);
 		}