Python: Fix test exclusion for stdlib Python 3.12

This commit is contained in:
Rasmus Wriedt Larsen
2024-02-14 16:53:19 +01:00
parent 59014787a1
commit eb401a205d
3 changed files with 104 additions and 98 deletions

View File

@@ -380,7 +380,12 @@ module BombsConfig implements DataFlow::ConfigSig {
predicate isSink(DataFlow::Node sink) { sink instanceof DecompressionBomb::Sink }
predicate isBarrierIn(DataFlow::Node node) {
node.getScope().getEnclosingModule().getName() in ["tarfile", "zipfile"]
node.getScope()
.getEnclosingModule()
.getFile()
.getAbsolutePath()
.matches(["%/tarfile.py", "%/zipfile.py", "%/zipfile/__init__.py"]) and
node.getScope().getEnclosingModule().getFile().inStdlib()
}
predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {