diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-12-17 07:10:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 07:10:20 -0800 |
commit | cb272843f2d5dfc4ef996ba952b99a3e30c88bbc (patch) | |
tree | 01fea7a9e86083677614812e0b85b1c8a29732a1 /Objects | |
parent | c367d52a74781b2c9ffd9e29722fbdfc0234408c (diff) | |
download | cpython-git-cb272843f2d5dfc4ef996ba952b99a3e30c88bbc.tar.gz |
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
(cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
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 4ef10d0eb7..4362615cb0 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -90,6 +90,10 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore int blockstack_top = 0; /* (ditto) */ unsigned char setup_op = 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, |