File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,7 +239,12 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
239239 // Sanitizers are currently not modeled in MaD. TODO: check if this has large negative impact.
240240 predicate isSanitizer ( Endpoint e , EndpointType t ) {
241241 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+ ] )
243248 or
244249 t instanceof AutomodelEndpointTypes:: PathInjectionSinkType and
245250 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 {
1818 AtomicReference <String > reference = new AtomicReference <>(); // uninteresting (parameterless constructor)
1919 reference .set ( // $ sinkModel=set(Object):Argument[this]
2020 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)
2222 }
2323
2424 public static void callSupplier (Supplier <String > supplier ) {
@@ -92,7 +92,7 @@ public static void FilesListExample(Path p) throws Exception {
9292
9393 Files .delete (
9494 p // $ sinkModel=delete(Path):Argument[0]
95- ); // $ SPURIOUS: sourceModel=delete(Path):ReturnValue
95+ ); // not a source candidate (return type is void)
9696
9797 Files .deleteIfExists (
9898 p // $ sinkModel=deleteIfExists(Path):Argument[0]
You can’t perform that action at this time.
0 commit comments