From f4cb6eb737cd22c355cb3b3b4f5f1ef215a8576b Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Sat, 10 Jul 2010 15:48:34 +0000 Subject: XPath: Out-of-bounds xpath_node_set access is now undefined git-svn-id: http://pugixml.googlecode.com/svn/trunk@581 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixpath.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/pugixpath.cpp') diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp index 6239ed2..80368ff 100644 --- a/src/pugixpath.cpp +++ b/src/pugixpath.cpp @@ -792,9 +792,10 @@ namespace pugi return size() == 0; } - xpath_node xpath_node_set::operator[](size_t index) const + const xpath_node& xpath_node_set::operator[](size_t index) const { - return (index >= size()) ? xpath_node() : m_begin[index]; + assert(index < size()); + return m_begin[index]; } xpath_node_set::iterator xpath_node_set::mut_begin() -- cgit v1.2.3