mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-04 20:37:50 +00:00
1bde5c68a3
This code was essentially duplicated between test_driver and standalone_fuzz_target_runner.
20 lines
535 B
C++
20 lines
535 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.getPointer()), size);
|
|
std::cout << argv[i] << " successful" << std::endl;
|
|
}
|
|
return 0;
|
|
}
|