This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 99d5d5f6f5 Correctly split literal "]]>" if it appears in CDATA
99d5d5f6f5 is described below
commit 99d5d5f6f55cb09c4d851ff29527831a71ff4c16
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jul 20 11:05:46 2026 +0100
Correctly split literal "]]>" if it appears in CDATA
---
java/org/apache/catalina/util/XMLWriter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/util/XMLWriter.java
b/java/org/apache/catalina/util/XMLWriter.java
index c14c9c2ad4..978cc0cf0d 100644
--- a/java/org/apache/catalina/util/XMLWriter.java
+++ b/java/org/apache/catalina/util/XMLWriter.java
@@ -247,8 +247,8 @@ public class XMLWriter {
int idx;
while ((idx = data.indexOf("]]>", start)) >= 0) {
buffer.append(data, start, idx);
- // We terminate, then append the ]]>, and restart the sequence
- buffer.append("]]>]]><![CDATA[");
+ // Embedded ']]>'. We append ']]', terminate, restart the
sequence, append '>' and then continue.
+ buffer.append("]]]]><![CDATA[>");
start = idx + 3;
}
buffer.append(data.substring(start));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]