fuzz_base64_decode.cc 582 B

123456789101112131415161718192021222324
  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. ** Main entry point. The fuzzer invokes this function with each
  9. ** fuzzed input.
  10. */
  11. #include <base64.h>
  12. extern "C" int
  13. LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
  14. size_t retLen;
  15. unsigned char* ret = UA_unbase64(data, size, &retLen);
  16. if (retLen > 0)
  17. free(ret);
  18. return 0;
  19. }