Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: testing/libfuzzer/pdf_fm2js_fuzzer.cc

Issue 1701103002: Add initial libfuzzers for fm2js transpiling and XML parsing. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: don't build fuzzers on windows Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers.gyp ('k') | testing/libfuzzer/pdf_xml_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The PDFium 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
5 #include <cstddef>
6 #include <cstdint>
7
8 #include "core/include/fxcrt/fx_basic.h"
9 #include "core/include/fxcrt/fx_string.h"
10 #include "xfa/src/fxfa/src/fm2js/xfa_fm2js.h"
11
12 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
13 if (size > std::numeric_limits<FX_STRSIZE>::max())
14 return 0;
15
16 CFX_WideString input = CFX_WideString::FromUTF8(
17 reinterpret_cast<const char*>(data), static_cast<FX_STRSIZE>(size));
18 CXFA_FMProgram program;
19 if (program.Init(input) || program.ParseProgram())
20 return 0;
21
22 CFX_WideTextBuf js;
23 program.TranslateProgram(js);
24 return 0;
25 }
OLDNEW
« no previous file with comments | « testing/libfuzzer/fuzzers.gyp ('k') | testing/libfuzzer/pdf_xml_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698