Skip to content

Commit c690e25

Browse files
Merge pull request github#3007 from RasmusWL/python-remove-use-of-deprecated-getvalue
Python: Remove usage of deprecated .getValue()
2 parents ea5aa57 + 70634fe commit c690e25

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

python/ql/src/Variables/MonkeyPatched.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ predicate monkey_patched_builtin(string name) {
55
subscr.isStore() and
66
subscr.getIndex().getNode() = s and
77
s.getText() = name and
8-
subscr.getValue() = attr and
8+
subscr.getObject() = attr and
99
attr.getObject("__dict__").pointsTo(Module::builtinModule())
1010
)
1111
or

python/ql/src/semmle/python/dataflow/TaintTracking.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ module DictKind {
286286
pragma[noinline]
287287
private predicate subscript_index(ControlFlowNode obj, SubscriptNode sub) {
288288
sub.isLoad() and
289-
sub.getValue() = obj and
289+
sub.getObject() = obj and
290290
not sub.getNode().getIndex() instanceof Slice
291291
}
292292

293293
pragma[noinline]
294294
private predicate subscript_slice(ControlFlowNode obj, SubscriptNode sub) {
295295
sub.isLoad() and
296-
sub.getValue() = obj and
296+
sub.getObject() = obj and
297297
sub.getNode().getIndex() instanceof Slice
298298
}
299299

python/ql/src/semmle/python/security/strings/Basic.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private predicate slice(ControlFlowNode fromnode, SubscriptNode tonode) {
104104
exists(Slice all |
105105
all = tonode.getIndex().getNode() and
106106
not exists(all.getStart()) and not exists(all.getStop()) and
107-
tonode.getValue() = fromnode
107+
tonode.getObject() = fromnode
108108
)
109109
}
110110

python/ql/src/semmle/python/security/strings/External.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private predicate json_subscript_taint(
134134
SubscriptNode sub, ControlFlowNode obj, ExternalJsonKind seq, TaintKind key
135135
) {
136136
sub.isLoad() and
137-
sub.getValue() = obj and
137+
sub.getObject() = obj and
138138
key = seq.getValue()
139139
}
140140

python/ql/src/semmle/python/values/StringAttributes.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private predicate tracking_step(ControlFlowNode src, ControlFlowNode dest) {
8282
or
8383
src = dest.(AttrNode).getObject()
8484
or
85-
src = dest.(SubscriptNode).getValue()
85+
src = dest.(SubscriptNode).getObject()
8686
or
8787
tracked_call_step(src, dest)
8888
or

python/ql/src/semmle/python/web/Http.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class WsgiEnvironment extends TaintKind {
2626
tonode.(CallNode).getFunction().(AttrNode).getObject("get") = fromnode and
2727
tonode.(CallNode).getArg(0).pointsTo(key)
2828
or
29-
tonode.(SubscriptNode).getValue() = fromnode and tonode.isLoad() and
29+
tonode.(SubscriptNode).getObject() = fromnode and tonode.isLoad() and
3030
tonode.(SubscriptNode).getIndex().pointsTo(key)
3131
|
3232
key = Value::forString(text) and result instanceof ExternalStringKind and
@@ -66,7 +66,7 @@ class UntrustedCookie extends TaintKind {
6666
}
6767

6868
override TaintKind getTaintForFlowStep(ControlFlowNode fromnode, ControlFlowNode tonode) {
69-
tonode.(SubscriptNode).getValue() = fromnode and
69+
tonode.(SubscriptNode).getObject() = fromnode and
7070
result instanceof UntrustedMorsel
7171
}
7272

python/ql/src/semmle/python/web/django/Request.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class DjangoRequest extends TaintKind {
2121
/* Helper for getTaintForStep() */
2222
pragma[noinline]
2323
private predicate subscript_taint(SubscriptNode sub, ControlFlowNode obj, TaintKind kind) {
24-
sub.getValue() = obj and
24+
sub.getObject() = obj and
2525
kind instanceof ExternalStringKind
2626
}
2727

0 commit comments

Comments
 (0)