Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3a8b79d

Browse files
committed
Issue #18408: Fix marshal reader for Unicode strings: handle
PyUnicode_DecodeUTF8() failure (ex: MemoryError).
1 parent b27cd3e commit 3a8b79d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Python/marshal.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,10 @@ r_object(RFILE *p)
998998
else {
999999
v = PyUnicode_New(0, 0);
10001000
}
1001+
if (v == NULL) {
1002+
retval = NULL;
1003+
break;
1004+
}
10011005
if (type == TYPE_INTERNED)
10021006
PyUnicode_InternInPlace(&v);
10031007
retval = v;

0 commit comments

Comments
 (0)