[ https://issues.apache.org/jira/browse/STDCXX-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov reassigned STDCXX-175: ------------------------------------ Assignee: Farid Zaripov > std::string::replace (size_type, size_type, const_pointer, size_type) doesn't > check last argument > ------------------------------------------------------------------------------------------------- > > Key: STDCXX-175 > URL: https://issues.apache.org/jira/browse/STDCXX-175 > Project: C++ Standard Library > Issue Type: Bug > Components: 21. Strings > Affects Versions: 4.1.3 > Environment: all > Reporter: Anton Pevtsov > Assignee: Farid Zaripov > Priority: Minor > > The following test fails with segmentation fault: > #include <iostream> > #include <string> > #include <stdexcept> > static char long_string [4096] = {'a'}; > int main (void) > { > try > { > std::string s (long_string, 4095); > s.replace (0, 1, "a", s.max_size () + 1); > std::cout << "Expect length error, got nothing" << '\n'; > } > catch (std::length_error& e) > { > std::cout << "Got expected length error" << '\n'; > } > return 0; > } > See the discussion for additional details: > http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200604.mbox/[EMAIL > PROTECTED] -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.