]> granicus.if.org Git - python/commitdiff
Add missing check of PyDict_Update()'s return value in _elementtree.c
authorChristian Heimes <christian@cheimes.de>
Sat, 20 Jul 2013 13:12:19 +0000 (15:12 +0200)
committerChristian Heimes <christian@cheimes.de>
Sat, 20 Jul 2013 13:12:19 +0000 (15:12 +0200)
CID 719637

1  2 
Modules/_elementtree.c

index 28bdf1effebf3d58035222db29129904cae02896,c179e965da5ea62ea20fb92b704e181818f6b8e0..d488f01b803a0d28095d6458eaa9622b17921daf
@@@ -308,9 -346,9 +308,10 @@@ get_attrib_from_keywords(PyObject *kwds
  
      Py_DECREF(attrib_str);
  
 +    /* attrib can be NULL if PyDict_New failed */
      if (attrib)
-         PyDict_Update(attrib, kwds);
+         if (PyDict_Update(attrib, kwds) < 0)
+             return NULL;
      return attrib;
  }