From: Victor Stinner Date: Mon, 8 Jul 2013 20:23:32 +0000 (+0200) Subject: Issue #18408: Fix marshal reader for Unicode strings: handle X-Git-Tag: v3.4.0a1~285 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a8b79d4d2b64e1a80512845edcc388b1ec76dcd;p=python Issue #18408: Fix marshal reader for Unicode strings: handle PyUnicode_DecodeUTF8() failure (ex: MemoryError). --- diff --git a/Python/marshal.c b/Python/marshal.c index e519fc9bfa..e97de59791 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -998,6 +998,10 @@ r_object(RFILE *p) else { v = PyUnicode_New(0, 0); } + if (v == NULL) { + retval = NULL; + break; + } if (type == TYPE_INTERNED) PyUnicode_InternInPlace(&v); retval = v;