From a2f884b11e216d338ac0bcee10922ac893ad8638 Mon Sep 17 00:00:00 2001 From: Chris White Date: Sat, 14 Jan 2023 18:12:03 -0500 Subject: [PATCH] fix: parse_ml_literal_string() properly issues invalid-utf8 errors Fix the same out-of-bounds read as in parse_literal_string(). --- toml/parser.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toml/parser.hpp b/toml/parser.hpp index 8da4618..de54ebf 100644 --- a/toml/parser.hpp +++ b/toml/parser.hpp @@ -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)