Skip to content

Commit 4da5222

Browse files
committed
Python: More safe methods for py/modification-of-default-value
Fixes github#3397
1 parent a01ef83 commit 4da5222

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

python/ql/src/Functions/ModificationOfParameterWithDefault.ql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ predicate safe_method(string name) {
2525
name = "values" or
2626
name = "iteritems" or
2727
name = "iterkeys" or
28-
name = "itervalues"
28+
name = "itervalues" or
29+
name = "__contains__" or
30+
name = "__getitem__" or
31+
name = "__getattribute__"
2932
}
3033

3134
/** Gets the truthiness (non emptyness) of the default of `p` if that value is mutable */

0 commit comments

Comments
 (0)