2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-02-09 23:28:29 +00:00
qpdf/fuzz/standalone_fuzz_target_runner.cc
Jay Berkenbilt 12f1eb15ca Programmatically apply new formatting to code
Run this:

for i in  **/*.cc **/*.c **/*.h **/*.hh; do
  clang-format < $i >| $i.new && mv $i.new $i
done
2022-04-04 08:10:40 -04:00

20 lines
524 B
C++

#include <qpdf/QUtil.hh>
#include <iostream>
#include <string>
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.get()), size);
std::cout << argv[i] << " successful" << std::endl;
}
return 0;
}