Remove alternate spelling of j#61v#61script from js.pdf We suspect it makes some AVs erroneously suspect that we are up to no good, and flag the file as suspect. It is usually best to just avoid the possibility of the warning, since some other AV will likely flag it again in the future. The unit tests for PDF_NameDecode() give sufficient coverage for this case. Change-Id: Ia186152167cafe17adcd7deeb72357bf1db41d17 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/72331 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/fpdf_javascript_embeddertest.cpp b/fpdfsdk/fpdf_javascript_embeddertest.cpp index 8ffc2d9..fd0a1d2 100644 --- a/fpdfsdk/fpdf_javascript_embeddertest.cpp +++ b/fpdfsdk/fpdf_javascript_embeddertest.cpp
@@ -31,12 +31,12 @@ TEST_F(FPDFJavaScriptEmbedderTest, GetJS) { ASSERT_TRUE(OpenDocument("js.pdf")); - EXPECT_EQ(6, FPDFDoc_GetJavaScriptActionCount(document())); + EXPECT_EQ(5, FPDFDoc_GetJavaScriptActionCount(document())); ScopedFPDFJavaScriptAction js; js.reset(FPDFDoc_GetJavaScriptAction(document(), -1)); EXPECT_FALSE(js); - js.reset(FPDFDoc_GetJavaScriptAction(document(), 6)); + js.reset(FPDFDoc_GetJavaScriptAction(document(), 5)); EXPECT_FALSE(js); js.reset(FPDFDoc_GetJavaScriptAction(nullptr, -1)); EXPECT_FALSE(js); @@ -48,21 +48,17 @@ EXPECT_FALSE(js); js.reset(FPDFDoc_GetJavaScriptAction(nullptr, 5)); EXPECT_FALSE(js); - js.reset(FPDFDoc_GetJavaScriptAction(nullptr, 6)); - EXPECT_FALSE(js); js.reset(FPDFDoc_GetJavaScriptAction(document(), 0)); EXPECT_TRUE(js); js.reset(FPDFDoc_GetJavaScriptAction(document(), 1)); EXPECT_TRUE(js); js.reset(FPDFDoc_GetJavaScriptAction(document(), 2)); - EXPECT_TRUE(js); + EXPECT_FALSE(js); js.reset(FPDFDoc_GetJavaScriptAction(document(), 3)); EXPECT_FALSE(js); js.reset(FPDFDoc_GetJavaScriptAction(document(), 4)); EXPECT_FALSE(js); - js.reset(FPDFDoc_GetJavaScriptAction(document(), 5)); - EXPECT_FALSE(js); } TEST_F(FPDFJavaScriptEmbedderTest, GetJSName) {
diff --git a/testing/resources/js.pdf b/testing/resources/js.pdf index 07e9b75..8d64866 100644 --- a/testing/resources/js.pdf +++ b/testing/resources/js.pdf
@@ -22,7 +22,6 @@ 4 0 obj << /Names [ (normal) 5 0 R - (encoded_subtype) 6 0 R (no_type) 7 0 R (wrongtype) 8 0 R (wrongsubtype) 9 0 R @@ -36,12 +35,6 @@ /JS 11 0 R >> endobj -6 0 obj << - /Type /Action - /S /J#61v#61Script - /JS 11 0 R ->> -endobj 7 0 obj << /S /JavaScript /JS 12 0 R