Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow error when input file contains too many "[" #32

Open
hongxuchen opened this issue Jun 5, 2018 · 1 comment
Open

Stack overflow error when input file contains too many "[" #32

hongxuchen opened this issue Jun 5, 2018 · 1 comment

Comments

@hongxuchen
Copy link

We found with our fuzzer that json_spirit may still suffer from stack overflow when input file contains too many [s.

Driver:

#include <string>
#include <fstream>
#include <streambuf>
#include <iostream>
#include "ciere/json/io.hpp"
#include "ciere/json/value.hpp"

using namespace ciere;

int main(int argc, char** argv) {
    std::ifstream t(argv[1]);
    std::string str((std::istreambuf_iterator<char>(t)),
            std::istreambuf_iterator<char>());
    auto res = json::construct(str);
    std::cout<<res<<"\n";
}

Sample input:
test.txt

@mjcaisse
Copy link
Member

mjcaisse commented Jun 5, 2018

Thanks for the report. Gotta love fuzzers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants