[Lxml-checkins] r48142 - in lxml/trunk: . src/lxml

scoder at codespeak.net scoder at codespeak.net
Mon Oct 29 11:09:26 CET 2007


Author: scoder
Date: Mon Oct 29 11:09:25 2007
New Revision: 48142

Modified:
   lxml/trunk/CHANGES.txt
   lxml/trunk/src/lxml/objectpath.pxi
Log:
fixed crash in ObjectPath

Modified: lxml/trunk/CHANGES.txt
==============================================================================
--- lxml/trunk/CHANGES.txt	(original)
+++ lxml/trunk/CHANGES.txt	Mon Oct 29 11:09:25 2007
@@ -25,6 +25,8 @@
 Bugs fixed
 ----------
 
+* Well hidden free-while-in-use crash bug in ObjectPath
+
 * In the ``lxml.html`` ``iter_links`` method, links in ``<object>``
   tags weren't recognized.  (Note: plugin-specific link parameters
   still aren't recognized.)  Also, the ``<embed>`` tag, though not

Modified: lxml/trunk/src/lxml/objectpath.pxi
==============================================================================
--- lxml/trunk/src/lxml/objectpath.pxi	(original)
+++ lxml/trunk/src/lxml/objectpath.pxi	Mon Oct 29 11:09:25 2007
@@ -140,7 +140,7 @@
             if index_pos is NULL:
                 index = 0
             else:
-                name = python.PyString_FromStringAndSize(
+                new_name = python.PyString_FromStringAndSize(
                     c_name, <Py_ssize_t>(index_pos - c_name))
                 index_pos = index_pos + 1
                 index_end = cstd.strchr(index_pos, c']')
@@ -151,6 +151,7 @@
                     index_pos, <Py_ssize_t>(index_end - index_pos)))
                 if python.PyList_GET_SIZE(new_path) == 0 and index != 0:
                     raise ValueError, "index not allowed on root node"
+                name = new_name
         python.PyList_Append(new_path, (ns, name, index))
     if python.PyList_GET_SIZE(new_path) == 0:
         raise ValueError, "invalid path"


More information about the lxml-checkins mailing list