summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-10-13 16:17:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-10-13 16:17:46 (GMT)
commit5f613dc87ca504b390c12b4ee0f1b65ab8731f27 (patch)
tree07519593c97917e200ab7cec8f345f777096e969
parent221d943c5bf8cfe61c06507012458f4140d8c875 (diff)
parent0a7697b718898f4ebc17ba261b786502a03ed738 (diff)
downloadcpython-5f613dc87ca504b390c12b4ee0f1b65ab8731f27.zip
cpython-5f613dc87ca504b390c12b4ee0f1b65ab8731f27.tar.gz
cpython-5f613dc87ca504b390c12b4ee0f1b65ab8731f27.tar.bz2
Merge heads
-rw-r--r--Python/marshal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 987d063..7273e7c 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;
}