summaryrefslogtreecommitdiffstats
path: root/Objects/frameobject.c
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-12-20 17:38:52 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-12-20 17:38:52 (GMT)
commitf347c6eb75ca46990cd7ad3efbe02002603d8460 (patch)
tree744adc5ac41e122e2084d8214cafb4fbc22be2b3 /Objects/frameobject.c
parent3752bc96c0ea1ecf28903cc34cdcd75c658e92ce (diff)
downloadcpython-f347c6eb75ca46990cd7ad3efbe02002603d8460.zip
cpython-f347c6eb75ca46990cd7ad3efbe02002603d8460.tar.gz
cpython-f347c6eb75ca46990cd7ad3efbe02002603d8460.tar.bz2
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175) (GH-11249)
(cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca)
Diffstat (limited to 'Objects/frameobject.c')
-rw-r--r--Objects/frameobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 1758745..4c91dd0 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -118,6 +118,10 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno)
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 (!PyInt_Check(p_new_lineno)) {
PyErr_SetString(PyExc_ValueError,