Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.1.3, 4.1.4, 4.2.0, 4.2.1
-
None
-
All
-
Incorrect Behavior
Description
The following test fails with segmentation fault:
#include <iostream> #include <string> #include <stdexcept> static char long_string [4096] = {'a'}; int main () { try { std::string s (long_string, 4095); s.replace (0, 1, s.max_size () + 1, 'a'); std::cout << "Expect length error, got nothing" << '\n'; } catch (std::length_error& e) { std::cout << "Got expected length error" << '\n'; } return 0; }
Attachments
Issue Links
- is depended upon by
-
STDCXX-1060 std::basic_string::append(char*, pos) SIGSEGV for pos == std::string::npos
- Resolved
- is related to
-
STDCXX-175 std::string::replace (size_type, size_type, const_pointer, size_type) doesn't check last argument
- Closed