[Zope3-checkins] CVS: Zope/lib/python/BTrees - BucketTemplate.c:1.47.10.5

Tim Peters tim.one at comcast.net
Thu Apr 29 18:52:44 EDT 2004


Update of /cvs-repository/Zope/lib/python/BTrees
In directory cvs.zope.org:/tmp/cvs-serv9795/lib/python/BTrees

Modified Files:
      Tag: Zope-2_6-branch
	BucketTemplate.c 
Log Message:
http://collector.zope.org/Zope/553   "sporadic Zope crashes"

BTree bucket conflict resolution could segfault if fed three empty
buckets.  Fixed, and a new test added that *will* segfault if you
don't recompile Zope's C code.


=== Zope/lib/python/BTrees/BucketTemplate.c 1.47.10.4 => 1.47.10.5 ===
--- Zope/lib/python/BTrees/BucketTemplate.c:1.47.10.4	Mon May 12 12:36:09 2003
+++ Zope/lib/python/BTrees/BucketTemplate.c	Thu Apr 29 18:52:13 2004
@@ -1270,7 +1270,10 @@
         }
       return NULL;
     }
-  Py_DECREF(r);
+  /* r can be NULL if (and only if) 3 empty buckets were passed in (3
+   * instances of Py_None), so this must be an XDECREF.
+   */
+  Py_XDECREF(r);
   r=NULL;
 
   if (b[0]->next != b[1]->next || b[0]->next != b[2]->next)




More information about the Zope3-Checkins mailing list