From 6dccaf3fcb0060a678df22db7029f7021ac83961 Mon Sep 17 00:00:00 2001 From: Pavol Droba Date: Fri, 12 Mar 2004 22:49:46 +0000 Subject: [PATCH] out-of-range iterator access fix [SVN r22493] --- include/boost/algorithm/string/detail/finder.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/algorithm/string/detail/finder.hpp b/include/boost/algorithm/string/detail/finder.hpp index 5229cde..7392b81 100644 --- a/include/boost/algorithm/string/detail/finder.hpp +++ b/include/boost/algorithm/string/detail/finder.hpp @@ -325,7 +325,7 @@ namespace boost { typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; - if ( (End<=Begin) || (End < (Begin+m_N) ) ) + if ( (End<=Begin) || ( static_cast(End-Begin) < m_N ) ) return result_type( Begin, End ); return result_type(Begin,Begin+m_N); @@ -414,7 +414,7 @@ namespace boost { typedef ForwardIteratorT input_iterator_type; typedef iterator_range result_type; - if ( (End<=Begin) || (End < (Begin+m_N) ) ) + if ( (End<=Begin) || ( static_cast(End-Begin) < m_N ) ) return result_type( Begin, End ); return result_type( End-m_N, End );