Skip to content

Commit

Permalink
Avoid invalid iterator dereference with empty values (skystrife#72)
Browse files Browse the repository at this point in the history
Fixes issue skystrife#71.
  • Loading branch information
hvariant authored and skystrife committed Apr 30, 2018
1 parent 3588b90 commit 53605ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cpptoml.h
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,10 @@ class parser
parse_type determine_value_type(const std::string::iterator& it,
const std::string::iterator& end)
{
if(it == end)
{
throw_parse_exception("Failed to parse value type");
}
if (*it == '"' || *it == '\'')
{
return parse_type::STRING;
Expand Down

0 comments on commit 53605ec

Please sign in to comment.