SOURCES: boost-archive_iterator_segv.patch (NEW) - fix SEGV in arc...

pluto pluto at pld-linux.org
Thu Jul 20 16:16:36 CEST 2006


Author: pluto                        Date: Thu Jul 20 14:16:36 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix SEGV in archive interator (xml archive specific issue).

---- Files affected:
SOURCES:
   boost-archive_iterator_segv.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/boost-archive_iterator_segv.patch
diff -u /dev/null SOURCES/boost-archive_iterator_segv.patch:1.1
--- /dev/null	Thu Jul 20 16:16:36 2006
+++ SOURCES/boost-archive_iterator_segv.patch	Thu Jul 20 16:16:31 2006
@@ -0,0 +1,74 @@
+--- boost_1_33_1/boost/archive/iterators/escape.hpp.orig	2006-07-20 16:13:40.880579250 +0200
++++ boost_1_33_1/boost/archive/iterators/escape.hpp	2006-07-20 16:13:54.897455250 +0200
+@@ -37,7 +37,8 @@
+         BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type,
+         single_pass_traversal_tag,
+         BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type
+-    >{
++    >
++{
+     typedef BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type base_value_type;
+     typedef BOOST_DEDUCED_TYPENAME boost::iterator_reference<Base>::type reference_type;
+     friend class boost::iterator_core_access;
+@@ -53,16 +54,29 @@
+     typedef escape<Derived, Base> this_t;
+ 
+     bool equal(const this_t & rhs) const {
+-        return 
+-            NULL == m_bnext
+-            && NULL == m_bend
+-            && this->base_reference() == rhs.base_reference()
+-        ;
++        if(m_full && ! rhs.m_full)
++            rhs.dereference();
++        else
++        if(! m_full && rhs.m_full)
++            dereference();
++        if(m_bnext != rhs.m_bnext)
++            return false;
++        if(this->base_reference() != rhs.base_reference())
++            return false;
++        return true;
++    }
++
++    reference_type dereference_impl() {
++        if(!m_full){
++            m_current_value = static_cast<Derived *>(this)->fill(m_bnext, m_bend);
++            m_full = true;
++        }
++        return m_current_value;
+     }
+ 
+     //Access the value referred to 
+     reference_type dereference() const {
+-        return m_current_value;
++        return const_cast<this_t *>(this)->dereference_impl();
+     }
+ 
+    void increment(){
+@@ -73,21 +87,21 @@
+         ++(this->base_reference());
+         m_bnext = NULL;
+         m_bend = NULL;
+-        m_current_value = (static_cast<Derived *>(this))->fill(m_bnext, m_bend);
++        m_full = false;
+     }
+ 
+     // buffer to handle pending characters
+     const base_value_type *m_bnext;
+     const base_value_type *m_bend;
+-    BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type m_current_value;
+     bool m_full;
++    BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type m_current_value;
+ public:
+     escape(Base base) : 
+         super_t(base),
+         m_bnext(NULL),
+-        m_bend(NULL)
++        m_bend(NULL),
++        m_full(false)
+     {
+-        m_current_value = static_cast<Derived *>(this)->fill(m_bnext, m_bend);
+     }
+ };
+ 
================================================================


More information about the pld-cvs-commit mailing list