mirror of
https://github.com/github/codeql.git
synced 2026-05-05 21:55:19 +02:00
Refactor tests to use InlineFlowTest
This commit is contained in:
@@ -9,39 +9,39 @@ public class SchemaTests {
|
||||
|
||||
public void unconfiguredSchemaFactory(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //unsafe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void safeSchemaFactory(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //safe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // safe
|
||||
}
|
||||
|
||||
public void partialConfiguredSchemaFactory1(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //unsafe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void partialConfiguredSchemaFactory2(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //unsafe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void misConfiguredSchemaFactory1(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "ab");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //unsafe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // $ hasTaintFlow
|
||||
}
|
||||
|
||||
public void misConfiguredSchemaFactory2(Socket sock) throws Exception {
|
||||
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, "cd");
|
||||
factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, "");
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); //unsafe
|
||||
Schema schema = factory.newSchema(new StreamSource(sock.getInputStream())); // $ hasTaintFlow
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user