From 580c159e8b8b1d38454f98276a57caf1acce98e6 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Thu, 29 Jun 2017 10:43:53 -0400 Subject: Cleanup call expression handling in fm2js Remove handling of arbitrary function calls, and only allow supported function calls. Issues with the lexer being overly permissive led to large blobs of javascript being dropped into the output. Specifically driver code was assuming that anything marked as a function would just be an identifier that could be inserted into the javascript, but the lexer marks things like ()()() as a function, which would lead to the following JS being inserted as an identifier. This change is intended to be a patch for the specific issue that was being seen from the fuzzer test, and further work will be needed to make the lexer more strict. BUG=724913 TEST=Ran fuzzer test case. Ran unittests,embeddertests,corpustests. Change-Id: Ib7d9239bf6fece853bea0f4915ee4ad72d3cd290 Reviewed-on: https://pdfium-review.googlesource.com/7032 Commit-Queue: Ryan Harrison Reviewed-by: Lei Zhang Reviewed-by: dsinclair --- testing/xfa_js_embedder_test.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'testing/xfa_js_embedder_test.h') diff --git a/testing/xfa_js_embedder_test.h b/testing/xfa_js_embedder_test.h index afbdb26e1a..1dc06f05e6 100644 --- a/testing/xfa_js_embedder_test.h +++ b/testing/xfa_js_embedder_test.h @@ -33,6 +33,8 @@ class XFAJSEmbedderTest : public EmbedderTest { CXFA_Document* GetXFADocument(); bool Execute(const CFX_ByteStringC& input); + bool ExecuteSilenceFailure(const CFX_ByteStringC& input); + CFXJSE_Value* GetValue() const { return value_.get(); } private: @@ -40,6 +42,8 @@ class XFAJSEmbedderTest : public EmbedderTest { std::unique_ptr value_; v8::Isolate* isolate_; CXFA_ScriptContext* script_context_; + + bool ExecuteHelper(const CFX_ByteStringC& input); }; #endif // TESTING_XFA_JS_EMBEDDER_TEST_H_ -- cgit v1.2.3