parse_format_rule_fuzzer.cc 638 B

12345678910111213141516
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include <stdint.h>
  5. #include "third_party/libaddressinput/src/cpp/src/address_field_util.h"
  6. #include "third_party/libaddressinput/src/cpp/src/format_element.h"
  7. // Entry point for LibFuzzer.
  8. extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  9. std::string input(reinterpret_cast<const char*>(data), size);
  10. std::vector<i18n::addressinput::FormatElement> format_element;
  11. i18n::addressinput::ParseFormatRule(input, &format_element);
  12. return 0;
  13. }