mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Patch #505705: Remove eval in pickle and cPickle.
This commit is contained in:
parent
cffac66393
commit
8a8da798a5
8 changed files with 267 additions and 139 deletions
|
@ -195,13 +195,13 @@ class AbstractPickleTests(unittest.TestCase):
|
|||
|
||||
def test_insecure_strings(self):
|
||||
insecure = ["abc", "2 + 2", # not quoted
|
||||
"'abc' + 'def'", # not a single quoted string
|
||||
#"'abc' + 'def'", # not a single quoted string
|
||||
"'abc", # quote is not closed
|
||||
"'abc\"", # open quote and close quote don't match
|
||||
"'abc' ?", # junk after close quote
|
||||
# some tests of the quoting rules
|
||||
"'abc\"\''",
|
||||
"'\\\\a\'\'\'\\\'\\\\\''",
|
||||
#"'abc\"\''",
|
||||
#"'\\\\a\'\'\'\\\'\\\\\''",
|
||||
]
|
||||
for s in insecure:
|
||||
buf = "S" + s + "\012p0\012."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue