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

20 lines
535 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)
{
for (int i = 1; i < argc; i++)
{
PointerHolder<char> file_buf;
size_t size = 0;
QUtil::read_file_into_memory(argv[i], file_buf, size);
LLVMFuzzerTestOneInput(
reinterpret_cast<unsigned char*>(file_buf.getPointer()), 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;
}