From 1b0138604a7c4fef645b6cba0a6468525c843c06 Mon Sep 17 00:00:00 2001 From: paolo Date: Mon, 2 Apr 2007 10:08:50 +0000 Subject: 2007-04-02 Paolo Carlini 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 --- libstdc++-v3/include/ext/vstring.tcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libstdc++-v3/include/ext/vstring.tcc') 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) -- cgit v1.2.1