mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Issue #17710: Fix pickle raising a SystemError on bogus input.
This commit is contained in:
commit
af94051a93
4 changed files with 15 additions and 5 deletions
|
@ -903,7 +903,7 @@ class _Unpickler:
|
|||
orig = self.readline()
|
||||
rep = orig[:-1]
|
||||
# Strip outermost quotes
|
||||
if rep[0] == rep[-1] and rep[0] in b'"\'':
|
||||
if len(rep) >= 2 and rep[0] == rep[-1] and rep[0] in b'"\'':
|
||||
rep = rep[1:-1]
|
||||
else:
|
||||
raise ValueError("insecure string pickle")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue