Skip to content

<string>: basic_string::replace fails under ASan when pos + count > size, and count2 < count  #3883

Description

#include <string>

int main()
{
  std::string t = "0123456789ABCDEF"; // large string
  t.replace(0, 30, 7, 'A'); // Address Sanitizer Error: Container overflow.
}

Looks like we (I) screwed up the logic here.

Reported in DevCom-10369462

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASanAddress SanitizerbugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions