Skip to content

Commit 4328dde

Browse files
committed
pickle: Replace exec() with eval(), smaller surface for security issues.
1 parent 73bd871 commit 4328dde

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pickle/pickle.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ def loads(s):
1818
pkg = qualname.rsplit(".", 1)[0]
1919
mod = __import__(pkg)
2020
d[pkg] = mod
21-
exec("v=" + s, d)
22-
return d["v"]
21+
return eval(s, d)

0 commit comments

Comments
 (0)