2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-02 11:46:35 +00:00
qpdf/fuzz/standalone_fuzz_target_runner.cc

20 lines
526 B
C++
Raw Normal View History

#include <qpdf/QUtil.hh>
2019-06-13 13:28:38 +00:00
#include <iostream>
#include <string>
2019-06-13 13:28:38 +00:00
extern "C" int LLVMFuzzerTestOneInput(unsigned char const* data, size_t size);
int
main(int argc, char** argv)
2019-06-13 13:28:38 +00:00
{
for (int i = 1; i < argc; i++) {
std::shared_ptr<char> file_buf;
size_t size = 0;
QUtil::read_file_into_memory(argv[i], file_buf, size);
LLVMFuzzerTestOneInput(
reinterpret_cast<unsigned char*>(file_buf.get()), size);
2019-06-14 16:34:23 +00:00
std::cout << argv[i] << " successful" << std::endl;
2019-06-13 13:28:38 +00:00
}
return 0;
}