Open UltimateEvil opened 4 months ago
I, for whichever reson, have a string which contains a CSV as a substring.
Currently when calling parse("1,2,3,4"sv.substr(2),format) the following code is executed
CSVReader parse(csv::string_view in, CSVFormat format) { std::stringstream stream(in.data()); return CSVReader(stream, format); }
This will read memory outside the string view due to the following constructor bing invoked:
explicit basic_stringstream ( std::basic_string<CharT, Traits, Allocator>&& str, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out);
In c++ 26 the following is fine
CSVReader parse(csv::string_view in, CSVFormat format) { std::stringstream stream(in); return CSVReader(stream, format); }
Untill then, please document this behaviour or change it so the call is instead using a correctly constructed string
CSVReader parse(csv::string_view in, CSVFormat format) { std::stringstream stream(std::string{in}); return CSVReader(stream, format); }
I, for whichever reson, have a string which contains a CSV as a substring.
Currently when calling parse("1,2,3,4"sv.substr(2),format) the following code is executed
This will read memory outside the string view due to the following constructor bing invoked:
In c++ 26 the following is fine
Untill then, please document this behaviour or change it so the call is instead using a correctly constructed string