components/stdcxx/patches/090-7088072-string.cc.patch
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 539 9db7f022d292
permissions -rw-r--r--
Close of build 04.

# Patch for CR 7088072 and 7088065
--- stdcxx-4.2.1/include/string.cc	2011-07-10 13:09:53.630466602 -0700
+++ stdcxx-4.2.1/include/string.cc	2011-09-10 13:20:30.199451960 -0700
@@ -415,6 +415,12 @@
                                    "size_type, size_type, value_type)"), 
                       __size0 - __xlen, max_size () - __count));
 
+    _RWSTD_REQUIRES (__count < (max_size () - __pos),
+                     (_RWSTD_ERROR_LENGTH_ERROR,
+                      _RWSTD_FUNC ("basic_string::replace (size_type, "
+                                   "size_type, size_type, value_type)"), 
+                      __count, (max_size () - __pos)));
+
     // compute the resulting string size
     const size_type __size1 = __size0 - __xlen + __count;