[GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-252-g052f124
Richard B. Kreckel
git at ginac.de
Sat Oct 9 18:41:17 CEST 2010
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GiNaC -- a C++ library for symbolic computations".
The branch, ginac_1-5 has been updated
via 052f124551d2b78104b0de2008db6b8819713625 (commit)
from c40c54f17b68f79ee42833adb3364970385e2caa (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 052f124551d2b78104b0de2008db6b8819713625
Author: Alexei Sheplyakov <alexei.sheplyakov at gmail.com>
Date: Sat Oct 9 18:39:41 2010 +0200
mul: algebraic_subs_mul(), has(): don't write beyond the end of array
algebraic_match_mul_with_mul() iterates over operands of mul, that is
for (size_t i=0; i<e.nops(); ++i)
However, the size of arrays (`vectors' in STL speak) passed to this
function is seq.size(), which is nops() - 1 for any mul object. Thus
algebraic_match_mul_with_mul() accesses beyond the arrays limit. Usually
it's not a problem, since any reasonable implementation of std::vector<bool>
packs booleans into ints (or longs). However, some STL implementations
(in particular, the one shipped with msvc) are more picky, and access
beyond the vector<bool> limits results in a segfault. Therefore let's
play safe and allocate proper number of elements (that is, nops()) for
those arrays (subsed and currsubsed).
(cherry picked from commit cbb93fadabbd56ba006902967b15b2b2aebb037c)
-----------------------------------------------------------------------
Summary of changes:
ginac/mul.cpp | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
hooks/post-receive
--
GiNaC -- a C++ library for symbolic computations
More information about the GiNaC-devel
mailing list