Skip to content

Commit

Permalink
do not load remote DTD
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T committed Oct 24, 2023
1 parent 26afaf9 commit 217d2a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
package org.eclipse.releng.generators;

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
Expand Down Expand Up @@ -642,6 +643,7 @@ private void parseCompileLog(final String log, final StringBuilder compilerLog,
@SuppressWarnings("restriction")
final DocumentBuilder builder = org.eclipse.core.internal.runtime.XmlProcessorFactory
.createDocumentBuilderIgnoringDOCTYPE();
builder.setEntityResolver((publicId, systemId) -> new InputSource(new ByteArrayInputStream(new byte[0])));

aDocument = builder.parse(inputSource);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

package org.eclipse.releng.build.tools.convert.ant;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
Expand Down Expand Up @@ -204,9 +205,10 @@ public void parse2() throws ParserConfigurationException {
final DocumentBuilderFactory factory = org.eclipse.core.internal.runtime.XmlProcessorFactory
.createDocumentBuilderFactoryIgnoringDOCTYPE();
final boolean validation = Boolean.parseBoolean(options.get(ENABLE_VALIDATION));
factory.setValidating(validation);
factory.setIgnoringElementContentWhitespace(true);
final DocumentBuilder builder = factory.newDocumentBuilder();
factory.setValidating(validation);
factory.setIgnoringElementContentWhitespace(true);
final DocumentBuilder builder = factory.newDocumentBuilder();
builder.setEntityResolver((publicId, systemId) -> new InputSource(new ByteArrayInputStream(new byte[0])));

final String inputSourceOption = options.get(INPUT_SOURCE);
if (options.get(RECURSIVE) != null) {
Expand Down

0 comments on commit 217d2a1

Please sign in to comment.