summaryrefslogtreecommitdiff
path: root/testing/libfuzzer
diff options
context:
space:
mode:
Diffstat (limited to 'testing/libfuzzer')
-rw-r--r--testing/libfuzzer/pdf_fm2js_fuzzer.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/testing/libfuzzer/pdf_fm2js_fuzzer.cc b/testing/libfuzzer/pdf_fm2js_fuzzer.cc
index 8cc98fcf54..226fb4096e 100644
--- a/testing/libfuzzer/pdf_fm2js_fuzzer.cc
+++ b/testing/libfuzzer/pdf_fm2js_fuzzer.cc
@@ -8,20 +8,16 @@
#include "core/fxcrt/fx_basic.h"
#include "core/fxcrt/fx_safe_types.h"
#include "core/fxcrt/fx_string.h"
-#include "xfa/fxfa/fm2js/cxfa_fmprogram.h"
+#include "xfa/fxfa/fm2js/cxfa_fm2jscontext.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FX_SAFE_STRSIZE safe_size = size;
if (!safe_size.IsValid())
return 0;
+ CFX_WideTextBuf js;
CFX_WideString input =
CFX_WideString::FromUTF8(CFX_ByteStringC(data, safe_size.ValueOrDie()));
- CXFA_FMProgram program(input.AsStringC());
- if (!program.ParseProgram())
- return 0;
-
- CFX_WideTextBuf js;
- program.TranslateProgram(js);
+ CXFA_FM2JSContext::Translate(input.AsStringC(), &js);
return 0;
}