Refactored SortTaintStep to ArrayInPlaceManipulationTaintStep to support both sort and reverse functions. Fixed newly added test case. from 8026a99db7

This commit is contained in:
Napalys
2024-11-08 12:30:39 +01:00
parent 1c298f0231
commit 81bc7cd19f
3 changed files with 5 additions and 4 deletions

View File

@@ -446,12 +446,12 @@ private module ArrayLibraries {
}
/**
* A taint propagating data flow edge arising from sorting.
* A taint propagating data flow edge arising from in-place array manipulation operations.
*/
private class SortTaintStep extends TaintTracking::SharedTaintStep {
private class ArrayInPlaceManipulationTaintStep extends TaintTracking::SharedTaintStep {
override predicate heapStep(DataFlow::Node pred, DataFlow::Node succ) {
exists(DataFlow::MethodCallNode call |
call.getMethodName() = "sort" and
call.getMethodName() in ["sort", "reverse"] and
pred = call.getReceiver() and
succ = call
)