/src/openbabel/test/fuzz/fuzz_obconversion.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | #include <stdio.h> |
2 | | #include <stdlib.h> |
3 | | #include <stdint.h> |
4 | | #include <stdarg.h> |
5 | | #include <string.h> |
6 | | |
7 | | #include <openbabel/babelconfig.h> |
8 | | #include <openbabel/mol.h> |
9 | | #include <openbabel/obconversion.h> |
10 | | #include <cstdlib> |
11 | | #include <stdio.h> |
12 | | #include <iostream> |
13 | | |
14 | | |
15 | 15.8k | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { |
16 | 15.8k | using namespace std; |
17 | 15.8k | using namespace OpenBabel; |
18 | 15.8k | OBConversion obconv; |
19 | 15.8k | OpenBabel::OBMol obmol; |
20 | 15.8k | std::string str (reinterpret_cast<const char*>(Data), Size); |
21 | | |
22 | | //FUZZ_INPUT_FORMAT is defined at compile time |
23 | 15.8k | if(!obconv.SetInFormat(FUZZ_INPUT_FORMAT)){ |
24 | 0 | abort(); |
25 | 0 | } |
26 | 15.8k | obconv.ReadString(&obmol, str); |
27 | 15.8k | return 0; |
28 | 15.8k | } |
29 | | |