summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/vstring.tcc
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-02 10:08:50 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-02 10:08:50 +0000
commit1b0138604a7c4fef645b6cba0a6468525c843c06 (patch)
treebe3c13d814365e3fa5cee2460c108c245f4eee79 /libstdc++-v3/include/ext/vstring.tcc
parentcad34aab89b8baa0e0eb6b9735aeecc2b3395004 (diff)
downloadgcc-1b0138604a7c4fef645b6cba0a6468525c843c06.tar.gz
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
Diffstat (limited to 'libstdc++-v3/include/ext/vstring.tcc')
-rw-r--r--libstdc++-v3/include/ext/vstring.tcc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/ext/vstring.tcc b/libstdc++-v3/include/ext/vstring.tcc
index 69dd5f04faa..43467a5ad57 100644
--- a/libstdc++-v3/include/ext/vstring.tcc
+++ b/libstdc++-v3/include/ext/vstring.tcc
@@ -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)