Boost logo

Boost :

Subject: Re: [boost] [1.48 lexical_cast] Illegal Derefence
From: Beman Dawes (bdawes_at_[hidden])
Date: 2011-11-02 17:46:41


On Wed, Nov 2, 2011 at 2:00 PM, Antony Polukhin <antoshkka_at_[hidden]> wrote:
> 2011/11/2 Olaf van der Spek <ml_at_[hidden]>:
>> Eh, why would you delay the fix?
>> It seems like a serious issue.
>
> This patch fixes the bug in more portable way:
>
>
> @@ -1147,7 +1147,7 @@
>                 bool const result = !(stream << input).fail();
>                 start = stringbuffer.pbase();
>                 finish = stringbuffer.pptr();
> -                return result;
> +                return result && (start != finish);
>             }
>
>             template <class T>
>
>
> All lexical_cast tests successfully passed with this patch on
> clang-linux-2.9, gcc-4.4, gcc-4.5 and gcc-4.6.
> This patch replaces Segmentation Fault with bad_lexical_cast exception
> (tested on code provided by Olaf van der Spek).
>
> OK to merge to release branch?

No. It needs to be applied to trunk, then given enough time to cycle
through the trunk regression tests. Once that happens, and the tests
are clear, then it might be appropriate to ask to merge to release.
Also, is there going to be a regression test added to detect the
problem in the future?

--Beman


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