mirror of
https://github.com/github/codeql.git
synced 2026-04-30 03:05:15 +02:00
Refactor tests to use InlineFlowTest
This commit is contained in:
@@ -5,18 +5,18 @@ public class SAXBuilderTests {
|
||||
|
||||
public void unconfiguredSAXBuilder(Socket sock) throws Exception {
|
||||
SAXBuilder builder = new SAXBuilder();
|
||||
builder.build(sock.getInputStream()); //unsafe
|
||||
builder.build(sock.getInputStream()); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
|
||||
public void safeBuilder(Socket sock) throws Exception {
|
||||
SAXBuilder builder = new SAXBuilder();
|
||||
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl",true);
|
||||
builder.build(sock.getInputStream()); //safe
|
||||
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
|
||||
builder.build(sock.getInputStream()); // safe
|
||||
}
|
||||
|
||||
public void misConfiguredBuilder(Socket sock) throws Exception {
|
||||
SAXBuilder builder = new SAXBuilder();
|
||||
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl",false);
|
||||
builder.build(sock.getInputStream()); //unsafe
|
||||
builder.setFeature("http://apache.org/xml/features/disallow-doctype-decl", false);
|
||||
builder.build(sock.getInputStream()); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user