Commit 1b013860 authored by paolo's avatar paolo
Browse files

2007-04-02 Paolo Carlini <pcarlini@suse.de>

	PR libstdc++/31401 (vstring bits)
	* include/ext/vstring.tcc (find(const _CharT*, size_type,
	size_type)): Avoid unsigned overflow.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123422 138bc75d-0d04-0410-961f-82ee72b054a4
parent cad34aab
2007-04-02 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/31401 (vstring bits)
* include/ext/vstring.tcc (find(const _CharT*, size_type,
size_type)): Avoid unsigned overflow.
2007-04-02 Paolo Carlini <pcarlini@suse.de>
* include/bits/locale_facets.tcc (num_put<>::do_put(iter_type,
......
......@@ -279,7 +279,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
if (__n <= __size)
{
for (; __pos + __n <= __size; ++__pos)
for (; __pos <= __size - __n; ++__pos)
if (traits_type::eq(__data[__pos], __s[0])
&& traits_type::compare(__data + __pos + 1,
__s + 1, __n - 1) == 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