diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-12-17 14:52:45 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-17 14:52:45 (GMT) |
commit | 842acaab1376c5c84fd5966bb6070e289880e1ca (patch) | |
tree | f21283245b7e349d05482b89fde8d570b33c53ab /Objects | |
parent | 4db62e115891425db2a974142a72d8eaaf95eecb (diff) | |
download | cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.zip cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.tar.gz cpython-842acaab1376c5c84fd5966bb6070e289880e1ca.tar.bz2 |
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 400f99f..8488b96 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -105,6 +105,10 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore int blockstack[CO_MAXBLOCKS]; /* Walking the 'finally' blocks */ int blockstack_top = 0; /* (ditto) */ + if (p_new_lineno == NULL) { + PyErr_SetString(PyExc_AttributeError, "cannot delete attribute"); + return -1; + } /* f_lineno must be an integer. */ if (!PyLong_CheckExact(p_new_lineno)) { PyErr_SetString(PyExc_ValueError, |