Skip to content

Commit 5330ce1

Browse files
committed
Use new TypeInputStream
1 parent 00e0e5a commit 5330ce1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private class BulkData extends RefType {
239239
this.(Array).getElementType().(PrimitiveType).hasName(["byte", "char"])
240240
or
241241
exists(RefType t | this.getASourceSupertype*() = t |
242-
t.hasQualifiedName("java.io", "InputStream") or
242+
t instanceof TypeInputStream or
243243
t.hasQualifiedName("java.nio", "ByteBuffer") or
244244
t.hasQualifiedName("java.lang", "Readable") or
245245
t.hasQualifiedName("java.io", "DataInput") or
@@ -259,7 +259,7 @@ private class BulkData extends RefType {
259259
private predicate inputStreamWrapper(Constructor c, int argi) {
260260
not c.fromSource() and
261261
c.getParameterType(argi) instanceof BulkData and
262-
c.getDeclaringType().getASourceSupertype+().hasQualifiedName("java.io", "InputStream")
262+
c.getDeclaringType().getASourceSupertype+() instanceof TypeInputStream
263263
}
264264

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

java/ql/lib/semmle/code/java/dispatch/VirtualDispatch.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private module Dispatch {
102102
or
103103
t instanceof Interface and not t.fromSource()
104104
or
105-
t.hasQualifiedName("java.io", "InputStream")
105+
t instanceof TypeInputStream
106106
or
107107
t.hasQualifiedName("java.io", "Serializable")
108108
or

java/ql/lib/semmle/code/java/frameworks/javaee/ejb/EJBRestrictions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class SystemSetInputStreamMethod extends Method {
317317
SystemSetInputStreamMethod() {
318318
this.hasName("setIn") and
319319
this.getNumberOfParameters() = 1 and
320-
this.getParameter(0).getType().(RefType).hasQualifiedName("java.io", "InputStream") and
320+
this.getParameter(0).getType() instanceof TypeInputStream and
321321
this.getDeclaringType()
322322
.getAnAncestor()
323323
.getSourceDeclaration()

java/ql/lib/semmle/code/java/frameworks/spring/SpringController.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class SpringRequestMappingParameter extends Parameter {
237237

238238
private predicate isExplicitlyTaintedInput() {
239239
// InputStream or Reader parameters allow access to the body of a request
240-
this.getType().(RefType).getAnAncestor().hasQualifiedName("java.io", "InputStream") or
240+
this.getType().(RefType).getAnAncestor() instanceof TypeInputStream or
241241
this.getType().(RefType).getAnAncestor().hasQualifiedName("java.io", "Reader") or
242242
// The SpringServletInputAnnotations allow access to the URI, request parameters, cookie values and the body of the request
243243
this.getAnAnnotation() instanceof SpringServletInputAnnotation or

0 commit comments

Comments
 (0)