chromium/third_party/pdfium/testing/fuzzers/pdf_xfa_fdp_fuzzer.cc

// Copyright 2021 The PDFium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <fuzzer/FuzzedDataProvider.h>

#include <string>
#include <vector>

#include "core/fxcrt/containers/adapters.h"
#include "public/fpdf_formfill.h"
#include "testing/fuzzers/pdf_fuzzer_templates.h"
#include "testing/fuzzers/pdfium_fuzzer_helper.h"

class PDFiumXFAFuzzer : public PDFiumFuzzerHelper {};

// Possible names of an XFA FormCalc script function
std::string GenXfaFormCalcScriptFuncName(FuzzedDataProvider* data_provider) {}

std::string MaybeQuote(FuzzedDataProvider* data_provider, std::string body) {}

// Possible arguments to a XFA script function
std::string GenXfaScriptParam(FuzzedDataProvider* data_provider) {}

// Possible XFA tags
std::string GenXfaTag(FuzzedDataProvider* data_provider) {}

// Possible XFA attributes values
std::string GenXfaTagValue(FuzzedDataProvider* data_provider) {}

// possible XFA attributes
std::string GenXfaTagName(FuzzedDataProvider* data_provider) {}

// Will create a simple XFA FormCalc script that calls a single function.
std::string GenXfaFormCalcScript(FuzzedDataProvider* data_provider) {}

// XFA Javascript logic
std::string GenXfaName(FuzzedDataProvider* data_provider) {}

std::string GetXfaJSPrimitiveType(FuzzedDataProvider* data_provider) {}

std::string GenXfaJSRValue(FuzzedDataProvider* data_provider) {}

std::string GenXfaJSAssignment(FuzzedDataProvider* data_provider) {}

std::string GenXfaJSMethodCall(FuzzedDataProvider* data_provider) {}

// This is a simple generator of xfa-based javascript. The function creates
// simple javascript statements that are related to XFA logic and the goal is
// not to create fully-fleged javascript programs but rather use simple
// statements to ensure XFA code is covered.
enum XFAJSStatement {};

std::string GenXfaJSScript(FuzzedDataProvider* data_provider) {}

std::string GenXfacript(FuzzedDataProvider* data_provider) {}

// Will create a single XFA attributes, with both lhs and rhs.
std::string getXfaElemAttributes(FuzzedDataProvider* data_provider) {}

// Creates an XFA structure wrapped in <xdp tags.
std::string GenXfaTree(FuzzedDataProvider* data_provider) {}

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {}