2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-16 01:27:07 +00:00
qpdf/fuzz/standalone_fuzz_target_runner.cc

19 lines
513 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);
2023-05-21 17:35:09 +00:00
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;
}