[issue13454] crash when deleting one pair from tee()

Amaury Forgeot d'Arc report at bugs.python.org
Tue Nov 22 17:28:15 CET 2011


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Also, a check for NULL would not hurt in tee_next():

diff -r 1e0e821d2626 Modules/itertoolsmodule.c
--- a/Modules/itertoolsmodule.c	Fri Nov 04 22:17:45 2011 +0100
+++ b/Modules/itertoolsmodule.c	Tue Nov 22 17:24:42 2011 +0100
@@ -475,6 +475,8 @@
 
     if (to->index >= LINKCELLS) {
         link = teedataobject_jumplink(to->dataobj);
+        if (link == NULL)
+            return NULL;
         Py_DECREF(to->dataobj);
         to->dataobj = (teedataobject *)link;
         to->index = 0;

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13454>
_______________________________________


More information about the Python-bugs-list mailing list