Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2006-05-26 10:38:21


Joaquín Mª López Muñoz ha escrito:

> Edson Tadeu reports on the following post
>
> http://lists.boost.org/boost-users/2006/05/19723.php
>
> about this bug in Boost.Format: line 138 of
> boost/format/format_implementation.hpp
>
> if( bound_.size()==0 || !bound_[ items_[i].argN_ ] )
>
> can try to invalidly evaluate bound_[...] on vector bound_
> with a negative index, which happens when items_[i].argN_ is
> one of the special values
>
> enum arg_values {
> argN_no_posit = -1, // non-positional directive. will set argN later
>
> argN_tabulation = -2, // tabulation directive. (no argument read)
> argN_ignored = -3 // ignored directive. (no argument read)
> };
>
> as defined in boost/format/internals.hpp. The attached patches to
> boost/format/format_implementation.hpp and
> libs/format/test/format_test3.cpp avoid the invalid negative indexing
> and add a testcase for the problem, respectively.
>
> Any objections to my commiting? If there's no comment I'll be doing
> it tomorrow.

Commited, both in HEAD and RC_1_34_0.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk