components/stdcxx/patches/065-6889785-string.patch
changeset 402 94ae4d75524c
equal deleted inserted replaced
401:bf52ef48020c 402:94ae4d75524c
       
     1 --- stdcxx-4.2.1/include/string	2011-01-07 11:48:23.120751627 -0500
       
     2 +++ stdcxx-4.2.1/include/string	2011-01-07 11:34:30.231689924 -0500
       
     3 @@ -874,7 +874,6 @@
       
     4      pointer _C_data;
       
     5  };
       
     6  
       
     7 -
       
     8  typedef basic_string<char, char_traits<char>, allocator<char> > string;
       
     9  
       
    10  #ifndef _RWSTD_NO_WCHAR_T
       
    11 @@ -884,7 +883,6 @@
       
    12  
       
    13  #endif   // _RWSTD_NO_WCHAR_T
       
    14  
       
    15 -
       
    16  template <class _CharT, class _Traits , class _Allocator>
       
    17  
       
    18  #if    !defined (__GNUG__)                  \
       
    19 @@ -1228,6 +1226,13 @@
       
    20  append (const_pointer __s, size_type __n)
       
    21  {
       
    22      const size_type __size0 = size ();
       
    23 +
       
    24 +	_RWSTD_REQUIRES (__n < (max_size() - __size0),
       
    25 +					(_RWSTD_ERROR_LENGTH_ERROR,
       
    26 +					_RWSTD_FUNC ("basic_string::append(const_pointer,"
       
    27 +							" size_type)"),
       
    28 +					 __n, max_size() - __size0));
       
    29 +
       
    30      const _RWSTD_SIZE_T __size1 = __size0 + __n;
       
    31  
       
    32      if (   capacity () <= __size1
       
    33 @@ -1248,6 +1253,13 @@
       
    34  append (size_type __n, value_type __c)
       
    35  {
       
    36      const size_type __size0 = size ();
       
    37 +
       
    38 +	_RWSTD_REQUIRES (__n < (max_size() - __size0),
       
    39 +					(_RWSTD_ERROR_LENGTH_ERROR,
       
    40 +					_RWSTD_FUNC ("basic_string::append(size_type,"
       
    41 +							" value_type)"),
       
    42 +					__n, max_size() - __size0));
       
    43 +
       
    44      const _RWSTD_SIZE_T __size1 = __size0 + __n;
       
    45  
       
    46      if (   capacity () < __size1