Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@strega-nil-ms

Description

@strega-nil-ms
#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

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