Skip to content

Commit 7f7c49d

Browse files
committed
Add the SimpleScalarSanitizer class
The `SimpleScalarSanitizer` class represents common scalar types which cannot realistically carry taint (e.g. primitives/numbers, and eventually UUIDs and Dates)
1 parent 24b37ff commit 7f7c49d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** Classes to represent sanitizers commonly used in dataflow and taint tracking configurations. */
2+
3+
import java
4+
import semmle.code.java.dataflow.DataFlow
5+
6+
/**
7+
* A node whose type is a common scalar type, such as primitives or their boxed counterparts.
8+
*/
9+
class SimpleScalarSanitizer extends DataFlow::Node {
10+
SimpleScalarSanitizer() {
11+
this.getType() instanceof PrimitiveType or
12+
this.getType() instanceof BoxedType or
13+
this.getType() instanceof NumberType
14+
}
15+
}

0 commit comments

Comments
 (0)