2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 19:08:59 +00:00
qpdf/fuzz/standalone_fuzz_target_runner.cc
Jay Berkenbilt 9044a24097 PointerHolder: deprecate getPointer() and getRefcount()
Use get() and use_count() instead. Add #define
NO_POINTERHOLDER_DEPRECATION to remove deprecation markers for these
only.

This commit also removes all deprecated PointerHolder API calls from
qpdf's code except in PointerHolder's test suite, which must continue
to test the deprecated APIs.
2022-02-04 13:12:37 -05:00

20 lines
528 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;
}