Merge pull request #13091 from atorralba/atorralba/java/inputstreamwrapper-transitive

Java: Make inputStreamWrapper consider supertypes transitively
This commit is contained in:
Tony Torralba
2023-05-23 13:28:17 +02:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Dataflow analysis has a new flow step through constructors of transitive subtypes of `java.io.InputStream` that wrap an underlying data source. Previously, the step only existed for direct subtypes of `java.io.InputStream`.

View File

@@ -255,8 +255,9 @@ private class BulkData extends RefType {
* status of its argument.
*/
private predicate inputStreamWrapper(Constructor c, int argi) {
not c.fromSource() and
c.getParameterType(argi) instanceof BulkData and
c.getDeclaringType().getASourceSupertype().hasQualifiedName("java.io", "InputStream")
c.getDeclaringType().getASourceSupertype+().hasQualifiedName("java.io", "InputStream")
}
/** An object construction that preserves the data flow status of any of its arguments. */