summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-11-23 06:47:26 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-11-23 06:47:26 (GMT)
commit3987fefd6f7309a36fb093cbfe229afe7b39406b (patch)
treee57eab9c07cc1c34906dee5e0f34cbe58c21a93f /Modules
parent21cecb904f80a53a23dc972c95cb0c4c997afbe1 (diff)
parentb6aa5375d5a2f81370338357506034befe62aa31 (diff)
downloadcpython-3987fefd6f7309a36fb093cbfe229afe7b39406b.zip
cpython-3987fefd6f7309a36fb093cbfe229afe7b39406b.tar.gz
cpython-3987fefd6f7309a36fb093cbfe229afe7b39406b.tar.bz2
Issue #25691: Fixed crash on deleting ElementTree.Element attributes.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 02cd6d4..744e833 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1921,6 +1921,12 @@ static int
element_setattro(ElementObject* self, PyObject* nameobj, PyObject* value)
{
char *name = "";
+
+ if (value == NULL) {
+ PyErr_SetString(PyExc_AttributeError,
+ "can't delete attribute");
+ return -1;
+ }
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
if (name == NULL)