Subject: [Boost-bugs] [Boost C++ Libraries] #5881: BGL isomorphism: off-by-one error in isomorphism.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-09 14:28:20
#5881: BGL isomorphism: off-by-one error in isomorphism.hpp
--------------------------------------------+-------------------------------
Reporter: Esa Määttä <esa.maatta@â¦> | Owner: jewillco
Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
Version: Boost 1.47.0 | Severity: Problem
Keywords: |
--------------------------------------------+-------------------------------
While in test_isomorphism() when creating a multiplicity vector, the
vector is possibly indexed with max_invariant while it's max index is
max_invariant-1.
The code in question is:
{{{#!cpp
154 std::vector<size_type> multiplicity(max_invariant, 0);
155 BGL_FORALL_VERTICES_T(v, G1, Graph1)
156 ++multiplicity[invariant1(v)];
}}}
Simple fix for this is to change the line 154 to:
{{{#!cpp
154 std::vector<size_type> multiplicity(max_invariant+1, 0);
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5881> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC