(original) (raw)

changeset: 84511:697d722d97f9 user: Victor Stinner victor.stinner@gmail.com date: Mon Jul 08 22:23:32 2013 +0200 files: Python/marshal.c description: Issue #18408: Fix marshal reader for Unicode strings: handle PyUnicode_DecodeUTF8() failure (ex: MemoryError). diff -r 68887e177dd4 -r 697d722d97f9 Python/marshal.c --- a/Python/marshal.c Mon Jul 08 22:20:44 2013 +0200 +++ b/Python/marshal.c Mon Jul 08 22:23:32 2013 +0200 @@ -998,6 +998,10 @@ else { v = PyUnicode_New(0, 0); } + if (v == NULL) { + retval = NULL; + break; + } if (type == TYPE_INTERNED) PyUnicode_InternInPlace(&v); retval = v; /victor.stinner@gmail.com