summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-08 20:23:32 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-08 20:23:32 (GMT)
commit3a8b79d4d2b64e1a80512845edcc388b1ec76dcd (patch)
treec746322b69591f7977f3903f330ca037edc90d3e /Python/marshal.c
parentb27cd3e5ad9e3da24cdce7f498fa64d2994788a0 (diff)
downloadcpython-3a8b79d4d2b64e1a80512845edcc388b1ec76dcd.zip
cpython-3a8b79d4d2b64e1a80512845edcc388b1ec76dcd.tar.gz
cpython-3a8b79d4d2b64e1a80512845edcc388b1ec76dcd.tar.bz2
Issue #18408: Fix marshal reader for Unicode strings: handle
PyUnicode_DecodeUTF8() failure (ex: MemoryError).
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index e519fc9..e97de59 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;