incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov (JIRA)" <j...@apache.org>
Subject [jira] Closed: (STDCXX-175) std::string::replace (size_type, size_type, const_pointer, size_type) doesn't check last argument
Date Tue, 24 Jul 2007 16:04:31 GMT

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

Farid Zaripov closed STDCXX-175.
--------------------------------


The regression test added thus: http://svn.apache.org/viewvc?view=rev&rev=559085

> 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.


Mime
View raw message