File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -239,7 +239,12 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
239
239
// Sanitizers are currently not modeled in MaD. TODO: check if this has large negative impact.
240
240
predicate isSanitizer ( Endpoint e , EndpointType t ) {
241
241
exists ( t ) and
242
- AutomodelJavaUtil:: isUnexploitableType ( e .asNode ( ) .getType ( ) )
242
+ AutomodelJavaUtil:: isUnexploitableType ( [
243
+ // for most endpoints, we can get the type from the node
244
+ e .asNode ( ) .getType ( ) ,
245
+ // but not for calls to void methods, where we need to go via the AST
246
+ e .asTop ( ) .( Expr ) .getType ( )
247
+ ] )
243
248
or
244
249
t instanceof AutomodelEndpointTypes:: PathInjectionSinkType and
245
250
e .asNode ( ) instanceof PathSanitizer:: PathInjectionSanitizer
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ public static void main(String[] args) throws Exception {
18
18
AtomicReference <String > reference = new AtomicReference <>(); // uninteresting (parameterless constructor)
19
19
reference .set ( // $ sinkModel=set(Object):Argument[this]
20
20
args [0 ] // not a sink candidate (modeled as a flow step)
21
- ); // $ sourceModel=set(Object):ReturnValue
21
+ ); // not a source candidate (return type is void)
22
22
}
23
23
24
24
public static void callSupplier (Supplier <String > supplier ) {
@@ -92,7 +92,7 @@ public static void FilesListExample(Path p) throws Exception {
92
92
93
93
Files .delete (
94
94
p // $ sinkModel=delete(Path):Argument[0]
95
- ); // $ SPURIOUS: sourceModel=delete(Path):ReturnValue
95
+ ); // not a source candidate (return type is void)
96
96
97
97
Files .deleteIfExists (
98
98
p // $ sinkModel=deleteIfExists(Path):Argument[0]
You can’t perform that action at this time.
0 commit comments