mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
Merge pull request #208 from cxw42/issue199-nonutf-string
Fix address-sanitizer error when parsing literal strings having invalid UTF-8 characters
This commit is contained in:
@@ -588,7 +588,8 @@ parse_ml_literal_string(location& loc)
|
||||
const auto first = loc.iter();
|
||||
if(const auto token = lex_ml_literal_string::invoke(loc))
|
||||
{
|
||||
location inner_loc(loc.name(), token.unwrap().str());
|
||||
auto inner_loc = loc;
|
||||
inner_loc.reset(first);
|
||||
|
||||
const auto open = lex_ml_literal_string_open::invoke(inner_loc);
|
||||
if(!open)
|
||||
@@ -664,7 +665,8 @@ parse_literal_string(location& loc)
|
||||
const auto first = loc.iter();
|
||||
if(const auto token = lex_literal_string::invoke(loc))
|
||||
{
|
||||
location inner_loc(loc.name(), token.unwrap().str());
|
||||
auto inner_loc = loc;
|
||||
inner_loc.reset(first);
|
||||
|
||||
const auto open = lex_apostrophe::invoke(inner_loc);
|
||||
if(!open)
|
||||
|
Reference in New Issue
Block a user