You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2007/07/24 18:02:31 UTC

[jira] Resolved: (STDCXX-175) std::string::replace (size_type, size_type, const_pointer, size_type) doesn't check last argument

     [ https://issues.apache.org/jira/browse/STDCXX-175?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov resolved STDCXX-175.
----------------------------------

    Resolution: Fixed

Fixed thus: http://svn.apache.org/viewvc?view=rev&rev=559084

> 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/%3c444EC747.1090200@roguewave.com%3e

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.