diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2013-10-13 15:19:56 (GMT) |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2013-10-13 15:19:56 (GMT) |
commit | 0a7697b718898f4ebc17ba261b786502a03ed738 (patch) | |
tree | db4d4b5530c22c1e14e43a8ac1e34197ce700462 /Python/marshal.c | |
parent | 26e066d34c751d5dae7c92adf58987f28eb1f5e7 (diff) | |
download | cpython-0a7697b718898f4ebc17ba261b786502a03ed738.zip cpython-0a7697b718898f4ebc17ba261b786502a03ed738.tar.gz cpython-0a7697b718898f4ebc17ba261b786502a03ed738.tar.bz2 |
Catch a few extra error cases in marshal.c
Diffstat (limited to 'Python/marshal.c')
-rw-r--r-- | Python/marshal.c | 4 |
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; } |