File: standalone_fuzz_target_runner.cc

package info (click to toggle)
qpdf 12.3.2-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 72,660 kB
  • sloc: cpp: 59,054; perl: 12,189; ansic: 6,809; sh: 1,231; python: 1,041; xml: 43; makefile: 42
file content (18 lines) | stat: -rw-r--r-- 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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++) {
        std::shared_ptr<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" << '\n';
    }
    return 0;
}