From: Kristján Valur Jónsson Date: Sun, 13 Oct 2013 15:19:56 +0000 (+0000) Subject: Catch a few extra error cases in marshal.c X-Git-Tag: v3.4.0a4~127^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a7697b718898f4ebc17ba261b786502a03ed738;p=thirdparty%2FPython%2Fcpython.git Catch a few extra error cases in marshal.c --- diff --git a/Python/marshal.c b/Python/marshal.c index 987d063f2741..7273e7cd3adb 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1297,6 +1297,8 @@ r_object(RFILE *p) if (name == NULL) goto code_error; firstlineno = (int)r_long(p); + if (firstlineno == -1 && PyErr_Occurred()) + break; lnotab = r_object(p); if (lnotab == NULL) goto code_error; @@ -1326,6 +1328,8 @@ r_object(RFILE *p) case TYPE_REF: n = r_long(p); if (n < 0 || n >= PyList_GET_SIZE(p->refs)) { + if (n == -1 && PyErr_Occurred()) + break; PyErr_SetString(PyExc_ValueError, "bad marshal data (invalid reference)"); break; }