JS: Use FlowState::fromFlowLabel instead of Label::toFlowState

This works better for other queries where we don't already have a module named Label
This commit is contained in:
Asger F
2024-12-10 11:13:00 +01:00
parent 38c9023dd9
commit 77f8e8ef4e
2 changed files with 8 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ module TaintedPath {
/** DEPRECATED. Use `blocksExpr` instead. */
deprecated predicate sanitizes(boolean outcome, Expr e, DataFlow::FlowLabel label) {
this.blocksExpr(outcome, e, Label::toFlowState(label))
this.blocksExpr(outcome, e, FlowState::fromFlowLabel(label))
}
}
@@ -178,11 +178,12 @@ module TaintedPath {
deprecated override Label::SplitPath toFlowLabel() { any() }
}
/** Convert the given flow label to the corresponding flow state. */
deprecated FlowState fromFlowLabel(DataFlow::FlowLabel label) { result.toFlowLabel() = label }
}
deprecated module Label {
FlowState toFlowState(DataFlow::FlowLabel label) { result.toFlowLabel() = label }
class Normalization = FlowState::Normalization;
class Relativeness = FlowState::Relativeness;
@@ -872,7 +873,8 @@ module TaintedPath {
DataFlow::Node src, DataFlow::Node dst, DataFlow::FlowLabel srclabel,
DataFlow::FlowLabel dstlabel
) {
isAdditionalFlowStep(src, Label::toFlowState(srclabel), dst, Label::toFlowState(dstlabel))
isAdditionalFlowStep(src, FlowState::fromFlowLabel(srclabel), dst,
FlowState::fromFlowLabel(dstlabel))
}
/**

View File

@@ -74,7 +74,7 @@ deprecated class Configuration extends DataFlow::Configuration {
DataFlow::Node src, DataFlow::Node dst, DataFlow::FlowLabel srclabel,
DataFlow::FlowLabel dstlabel
) {
ZipSlipConfig::isAdditionalFlowStep(src, TaintedPath::Label::toFlowState(srclabel), dst,
TaintedPath::Label::toFlowState(dstlabel))
ZipSlipConfig::isAdditionalFlowStep(src, TaintedPath::FlowState::fromFlowLabel(srclabel), dst,
TaintedPath::FlowState::fromFlowLabel(dstlabel))
}
}