[Checkins] SVN: zope.security/branches/3.4/ Backported fix for segfault (LP bug 181833).

Benji York benji at zope.com
Thu Nov 26 09:26:41 EST 2009


Log message for revision 106026:
  Backported fix for segfault (LP bug 181833).
  

Changed:
  U   zope.security/branches/3.4/CHANGES.txt
  U   zope.security/branches/3.4/src/zope/security/_proxy.c

-=-
Modified: zope.security/branches/3.4/CHANGES.txt
===================================================================
--- zope.security/branches/3.4/CHANGES.txt	2009-11-26 13:28:29 UTC (rev 106025)
+++ zope.security/branches/3.4/CHANGES.txt	2009-11-26 14:26:41 UTC (rev 106026)
@@ -2,8 +2,21 @@
 CHANGES
 =======
 
+3.4.3 - (2009/11/26)
+--------------------
+
+- Backported a fix made by Gary Poster to the 3.4 branch:
+  Fix for LP bug 181833 (from Gustavo Niemeyer). Before "visiting" a
+  sub-object, a check should be made to ensure the object is still valid.
+  Because garbage collection may involve loops, if you garbage collect an
+  object, it is possible that the actions done on this object may modify the
+  state of other objects. This may cause another round of garbage collection,
+  eventually generating a segfault (see LP bug). The Py_VISIT macro does the
+  necessary checks, so it is used instead of the previous code.
+
+
 3.4.2 - (2009/03/23)
--------------------------------
+--------------------
 
 - Added dependency 'zope.thread' to setup.py, without the tests were
   failing.

Modified: zope.security/branches/3.4/src/zope/security/_proxy.c
===================================================================
--- zope.security/branches/3.4/src/zope/security/_proxy.c	2009-11-26 13:28:29 UTC (rev 106025)
+++ zope.security/branches/3.4/src/zope/security/_proxy.c	2009-11-26 14:26:41 UTC (rev 106026)
@@ -302,10 +302,8 @@
 static int
 proxy_traverse(SecurityProxy *self, visitproc visit, void *arg)
 {
-  if (visit(self->proxy.proxy_object, arg) < 0)
-    return -1;
-  if (visit(self->proxy_checker, arg) < 0)
-    return -1;
+  Py_VISIT(self->proxy.proxy_object);
+  Py_VISIT(self->proxy_checker);
   return 0;
 }
 



More information about the checkins mailing list