/src/open62541/tests/fuzz/fuzz_base64_encode.cc
Line | Count | Source |
1 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | | * |
5 | | * Copyright 2019 (c) fortiss (Author: Stefan Profanter) |
6 | | */ |
7 | | |
8 | | |
9 | | |
10 | | /* |
11 | | ** Main entry point. The fuzzer invokes this function with each |
12 | | ** fuzzed input. |
13 | | */ |
14 | | #include <base64.h> |
15 | | #include <malloc.h> |
16 | | |
17 | | extern "C" int |
18 | 210 | LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { |
19 | 210 | size_t retLen; |
20 | 210 | unsigned char* ret = UA_base64(data, size, &retLen); |
21 | 210 | if (retLen > 0) |
22 | 202 | free(ret); |
23 | 210 | return 0; |
24 | 210 | } |