Skip to content

Commit 6f012d5

Browse files
authored
Merge pull request github#13091 from atorralba/atorralba/java/inputstreamwrapper-transitive
Java: Make inputStreamWrapper consider supertypes transitively
2 parents 8cef798 + 1839154 commit 6f012d5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* 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`.

java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,9 @@ private class BulkData extends RefType {
255255
* status of its argument.
256256
*/
257257
private predicate inputStreamWrapper(Constructor c, int argi) {
258+
not c.fromSource() and
258259
c.getParameterType(argi) instanceof BulkData and
259-
c.getDeclaringType().getASourceSupertype().hasQualifiedName("java.io", "InputStream")
260+
c.getDeclaringType().getASourceSupertype+().hasQualifiedName("java.io", "InputStream")
260261
}
261262

262263
/** An object construction that preserves the data flow status of any of its arguments. */

0 commit comments

Comments
 (0)