Commit 230377dc by David Asher Committed by Paolo Carlini

re PR libstdc++/11352 (crash while internal padding numeric 0)

2004-02-15  David Asher  <david.asher@cavium.com>

	PR libstdc++/11352
	* include/bits/locale_facets.tcc (__pad<>::_S_pad): Don't
	access __olds beyond __oldlen.

From-SVN: r77858
parent bf3e8283
2004-02-15 David Asher <david.asher@cavium.com>
PR libstdc++/11352
* include/bits/locale_facets.tcc (__pad<>::_S_pad): Don't
access __olds beyond __oldlen.
2004-02-14 Paolo Carlini <pcarlini@suse.de>
* testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc: Make
......
......@@ -2261,14 +2261,14 @@ namespace std
// Who came up with these rules, anyway? Jeeze.
const locale& __loc = __io._M_getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const _CharT __minus = __ctype.widen('-');
const _CharT __plus = __ctype.widen('+');
const bool __testsign = _Traits::eq(__olds[0], __minus)
|| _Traits::eq(__olds[0], __plus);
const bool __testhex = _Traits::eq(__ctype.widen('0'), __olds[0])
const bool __testsign = _Traits::eq(__ctype.widen('-'), __olds[0])
|| _Traits::eq(__ctype.widen('+'), __olds[0]);
const bool __testhex = (_Traits::eq(__ctype.widen('0'), __olds[0])
&& __oldlen > 1
&& (_Traits::eq(__ctype.widen('x'), __olds[1])
|| _Traits::eq(__ctype.widen('X'), __olds[1]));
|| _Traits::eq(__ctype.widen('X'),
__olds[1])));
if (__testhex)
{
__news[0] = __olds[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment