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

Tim Peters tim.one at comcast.net
Thu Apr 29 17:52:21 EDT 2004


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

Modified Files:
      Tag: Zope-2_7-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.54 => 1.54.4.1 ===
--- Zope/lib/python/BTrees/BucketTemplate.c:1.54	Sun May 11 20:36:17 2003
+++ Zope/lib/python/BTrees/BucketTemplate.c	Thu Apr 29 17:51:50 2004
@@ -1278,7 +1278,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