mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Fixed reference leak when read truncated pickle.
This commit is contained in:
commit
fbc3e374a6
1 changed files with 3 additions and 1 deletions
|
@ -5247,8 +5247,10 @@ load_inst(UnpicklerObject *self)
|
|||
return -1;
|
||||
|
||||
if ((len = _Unpickler_Readline(self, &s)) >= 0) {
|
||||
if (len < 2)
|
||||
if (len < 2) {
|
||||
Py_DECREF(module_name);
|
||||
return bad_readline();
|
||||
}
|
||||
class_name = PyUnicode_DecodeASCII(s, len - 1, "strict");
|
||||
if (class_name != NULL) {
|
||||
cls = find_class(self, module_name, class_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue