This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Tighten length error check in string::replace


Paolo Carlini wrote:

> Thinking more about this, I'm finding this bug pretty serious and 
> would even ask for having the patch in 3.1.0, if still possible.

This is a testcase which currently /wrongly/ throws (aborts), and should 
not (it doesn't with the patch applied):

#include <string>

int main()
{
  std::string aa = "londinium";
  std::string bb = "cydonia";

  aa.replace(0, 20, bb.c_str(), 3);
}

Paolo.

 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]