https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92853
Bug ID: 92853
Summary: std::filesystem::path::operator+=(std::filesystem::pat
h const&) corrupts the heap
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at mattwhitlock dot name
Target Milestone: ---
// BEGIN test.cpp
#include <filesystem>
int main() {
using std::filesystem::path;
path p1{ "." }, p2{ "/" };
p1 += p2; // corrupts heap
path p3{ p1 }; // CRASH!
return 0;
}
// END test.cpp
$ g++ -std=gnu++2a -o test test.cpp
$ ./test
malloc(): corrupted top size
Aborted