aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2024-08-27 01:31:44 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2024-08-27 09:21:51 +0200
commit692ccfc0c29d53afc7a0b82f41efcd999ed217b0 (patch)
tree274e3ac46d586e485ff81e048be47d2f46833121
parentd66175d7dca30be7ab96af0e3998f795a174b891 (diff)
downloadjgit-692ccfc0c29d53afc7a0b82f41efcd999ed217b0.tar.gz
jgit-692ccfc0c29d53afc7a0b82f41efcd999ed217b0.zip
AmazonS3: Ensure SAXParserFactory sets valid/expected input params
Change Ie8a9d411fc19e8b7bf86c0b4df0b02153a0e9444 broke setting valid/expected input parameters for the XML parser. This can be fixed by calling SaxParserFactory#setNamespaceAware, see [1]. Also see earlier fix in [2]. [1] https://stackoverflow.com/questions/24891323/namespace-handling-with-sax-in-java [2] I05e993032ab3a6afb78634290b578ebc73cf1cbd Bug: jgit-87 Change-Id: Id4e9eebac8d9de81e5d48a608066db3cc862e15c
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
index b873925316..aaf9f8a08a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java
@@ -757,8 +757,10 @@ public class AmazonS3 {
final XMLReader xr;
try {
- xr = SAXParserFactory.newInstance().newSAXParser()
- .getXMLReader();
+ SAXParserFactory saxParserFactory = SAXParserFactory
+ .newInstance();
+ saxParserFactory.setNamespaceAware(true);
+ xr = saxParserFactory.newSAXParser().getXMLReader();
} catch (SAXException | ParserConfigurationException e) {
throw new IOException(
JGitText.get().noXMLParserAvailable, e);