You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include"toml.hpp"
#include<iostream>intmain(int argc, char* argv[]) {
if (argc != 2) {
return0;
}
try {
auto data = toml::parse(argv[1]);
std::cout << std::setw(80) << data << std::endl;
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
}
return0;
}
file name is passed to program with argv[1].
input file
b =0b11#= [ 8000,owner]name = "Wom Preston-Werner"dob = 1979-05-27T07:32:00-08:00# First class dateabase]server =[ ]
connection_mdx = 5000eKabled = true
[servers]
################################/or spaces) is allowed but not red
[server.alpha]
ip = "10.0.0.1"dc = "eqdc10"
[servers.beta]
ip = "10.8:00 # First class dateabas##################################################################################################################################################] ]# Line breaks are OK when inside arrayshosts = ["alpha","omega"]
the TOML above was generated by a fuzzer and lead to a crash of the parser.
stack trace
#0 0x00005555555a562b in toml::basic_value<toml::discard_comments, std::unordered_map, std::vector>::is (this=0xffffffffffffffb8, t=toml::value_t::table)
at toml/value.hpp:1165
#1 0x0000555555596fc3 in toml::basic_value<toml::discard_comments, std::unordered_map, std::vector>::is_table (this=0xffffffffffffffb8)
at toml/value.hpp:1177
#2 0x00005555555944fc in toml::detail::insert_nested_key<toml::basic_value<toml::discard_comments, std::unordered_map, std::vector>, __gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > (
root=std::unordered_map with 7 elements = {...}, v=..., iter="server",
last=<error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, key_reg=..., is_array_of_table=false)
at toml/parser.hpp:1773
--Type <RET> for more, q to quit, c to continue without paging--
#3 0x00005555555828e4 in toml::detail::parse_toml_file<toml::basic_value<toml::discard_comments, std::unordered_map, std::vector> > (loc=...)
at toml/parser.hpp:2438
#4 0x00005555555a547e in toml::detail::parse<toml::discard_comments, std::unordered_map, std::vector> (letters=std::vector of length 0, capacity 0,
fname="./crashes/id:000000,sig:11,src:001941+001131,op:splice,rep:4") at toml/parser.hpp:2489
#5 0x0000555555596ebd in toml::parse<toml::discard_comments, std::unordered_map, std::vector> (is=...,
fname="./crashes/id:000000,sig:11,src:001941+001131,op:splice,rep:4") at toml/parser.hpp:2558
#6 0x0000555555583622 in toml::parse<toml::discard_comments, std::unordered_map, std::vector> (fname="") at toml/parser.hpp:2573
#7 0x000055555555a20f in main (argc=2, argv=0x7fffffffdf18) at driver.cpp:8
The text was updated successfully, but these errors were encountered:
program
file name is passed to program with argv[1].
input file
the TOML above was generated by a fuzzer and lead to a crash of the parser.
stack trace
The text was updated successfully, but these errors were encountered: