File: eval.py

package info (click to toggle)
bandit 1.7.10-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 5,796 kB
  • sloc: python: 19,688; makefile: 23; sh: 14
file content (15 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os

print(eval("1+1"))
print(eval("os.getcwd()"))
print(eval("os.chmod('%s', 0777)" % 'test.txt'))


# A user-defined method named "eval" should not get flagged.
class Test(object):
    def eval(self):
        print("hi")
    def foo(self):
        self.eval()

Test().eval()