File: fuzz_base64_encode.cc

package info (click to toggle)
open62541 1.4.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 129,032 kB
  • sloc: xml: 1,678,567; cs: 229,004; ansic: 195,263; python: 4,888; sh: 1,456; cpp: 355; makefile: 30
file content (24 lines) | stat: -rw-r--r-- 600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 *    Copyright 2019 (c) fortiss (Author: Stefan Profanter)
 */



/*
** Main entry point.  The fuzzer invokes this function with each
** fuzzed input.
*/
#include <base64.h>
#include <malloc.h>

extern "C" int
LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
    size_t retLen;
    unsigned char* ret = UA_base64(data, size, &retLen);
    if (retLen > 0)
        free(ret);
    return 0;
}