From 692ccfc0c29d53afc7a0b82f41efcd999ed217b0 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Tue, 27 Aug 2024 01:31:44 +0200 Subject: 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 --- org.eclipse.jgit/src/org/eclipse/jgit/transport/AmazonS3.java | 6 ++++-- 1 file 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); -- cgit v1.2.3