Skip to content

Commit

Permalink
[SECURITY-2337]
Browse files Browse the repository at this point in the history
  • Loading branch information
rsandell committed Oct 14, 2022
1 parent 326c5e6 commit 4c4a72c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/hudson/plugins/repo/RevisionState.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
import java.util.logging.Logger;

import javax.annotation.Nullable;
import javax.xml.parsers.DocumentBuilderFactory;

import jenkins.util.xml.XMLUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;

/**
* A RevisionState records the state of the repository for a particular build.
Expand Down Expand Up @@ -86,12 +85,7 @@ class RevisionState extends SCMRevisionState implements Serializable {
this.branch = branch;
this.file = file;
try {
final InputSource xmlSource = new InputSource();
xmlSource.setCharacterStream(new StringReader(manifest));
final Document doc =
DocumentBuilderFactory.newInstance().newDocumentBuilder()
.parse(xmlSource);

final Document doc = XMLUtils.parse(new StringReader(manifest));
if (!doc.getDocumentElement().getNodeName().equals("manifest")) {
if (logger != null) {
logger.println("Error - malformed manifest");
Expand Down

0 comments on commit 4c4a72c

Please sign in to comment.