mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Remove usage of deprecated .getValue()
This commit is contained in:
@@ -5,7 +5,7 @@ predicate monkey_patched_builtin(string name) {
|
||||
subscr.isStore() and
|
||||
subscr.getIndex().getNode() = s and
|
||||
s.getText() = name and
|
||||
subscr.getValue() = attr and
|
||||
subscr.getObject() = attr and
|
||||
attr.getObject("__dict__").pointsTo(Module::builtinModule())
|
||||
)
|
||||
or
|
||||
|
||||
@@ -286,14 +286,14 @@ module DictKind {
|
||||
pragma[noinline]
|
||||
private predicate subscript_index(ControlFlowNode obj, SubscriptNode sub) {
|
||||
sub.isLoad() and
|
||||
sub.getValue() = obj and
|
||||
sub.getObject() = obj and
|
||||
not sub.getNode().getIndex() instanceof Slice
|
||||
}
|
||||
|
||||
pragma[noinline]
|
||||
private predicate subscript_slice(ControlFlowNode obj, SubscriptNode sub) {
|
||||
sub.isLoad() and
|
||||
sub.getValue() = obj and
|
||||
sub.getObject() = obj and
|
||||
sub.getNode().getIndex() instanceof Slice
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ private predicate slice(ControlFlowNode fromnode, SubscriptNode tonode) {
|
||||
exists(Slice all |
|
||||
all = tonode.getIndex().getNode() and
|
||||
not exists(all.getStart()) and not exists(all.getStop()) and
|
||||
tonode.getValue() = fromnode
|
||||
tonode.getObject() = fromnode
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ private predicate json_subscript_taint(
|
||||
SubscriptNode sub, ControlFlowNode obj, ExternalJsonKind seq, TaintKind key
|
||||
) {
|
||||
sub.isLoad() and
|
||||
sub.getValue() = obj and
|
||||
sub.getObject() = obj and
|
||||
key = seq.getValue()
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ private predicate tracking_step(ControlFlowNode src, ControlFlowNode dest) {
|
||||
or
|
||||
src = dest.(AttrNode).getObject()
|
||||
or
|
||||
src = dest.(SubscriptNode).getValue()
|
||||
src = dest.(SubscriptNode).getObject()
|
||||
or
|
||||
tracked_call_step(src, dest)
|
||||
or
|
||||
|
||||
@@ -26,7 +26,7 @@ class WsgiEnvironment extends TaintKind {
|
||||
tonode.(CallNode).getFunction().(AttrNode).getObject("get") = fromnode and
|
||||
tonode.(CallNode).getArg(0).pointsTo(key)
|
||||
or
|
||||
tonode.(SubscriptNode).getValue() = fromnode and tonode.isLoad() and
|
||||
tonode.(SubscriptNode).getObject() = fromnode and tonode.isLoad() and
|
||||
tonode.(SubscriptNode).getIndex().pointsTo(key)
|
||||
|
|
||||
key = Value::forString(text) and result instanceof ExternalStringKind and
|
||||
@@ -66,7 +66,7 @@ class UntrustedCookie extends TaintKind {
|
||||
}
|
||||
|
||||
override TaintKind getTaintForFlowStep(ControlFlowNode fromnode, ControlFlowNode tonode) {
|
||||
tonode.(SubscriptNode).getValue() = fromnode and
|
||||
tonode.(SubscriptNode).getObject() = fromnode and
|
||||
result instanceof UntrustedMorsel
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class DjangoRequest extends TaintKind {
|
||||
/* Helper for getTaintForStep() */
|
||||
pragma[noinline]
|
||||
private predicate subscript_taint(SubscriptNode sub, ControlFlowNode obj, TaintKind kind) {
|
||||
sub.getValue() = obj and
|
||||
sub.getObject() = obj and
|
||||
kind instanceof ExternalStringKind
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user