Handle empty keys

kimkulling-patch-fuzzer_Issue_25058
Kim Kulling 2021-08-27 10:41:25 +02:00 committed by GitHub
parent e7085199f2
commit eabfc05bbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,10 @@ Scope::Scope(Parser& parser,bool topLevel)
}
const std::string& str = n->StringContents();
if (str.empty()) {
ParseError("unexpected content: empty string.");
}
elements.insert(ElementMap::value_type(str,new_Element(*n,parser)));
// Element() should stop at the next Key token (or right after a Close token)