[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/security/_proxy.c Added a sanity check to make sure that None isn't passed as a checker.

Jim Fulton jim at zope.com
Fri Jul 2 18:04:49 EDT 2004


Log message for revision 26077:
Added a sanity check to make sure that None isn't passed as a checker.



-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/security/_proxy.c
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/security/_proxy.c	2004-07-02 21:01:58 UTC (rev 26076)
+++ Zope3/branches/ZopeX3-3.0/src/zope/security/_proxy.c	2004-07-02 22:04:49 UTC (rev 26077)
@@ -259,6 +259,13 @@
                                    "OO:_Proxy.__new__", kwlist,
                                    &object, &checker))
     return NULL;
+
+  if (checker == Py_None)
+    {
+      PyErr_SetString(PyExc_ValueError, "None passed as checker proxy");
+      return NULL;
+    }
+
   self = (SecurityProxy *)type->tp_alloc(type, 0);
   if (self == NULL)
     return NULL;



More information about the Zope3-Checkins mailing list