Skip to content

Commit

Permalink
Change XFA fuzzer to use new API for detecting XFA forms
Browse files Browse the repository at this point in the history
Includes a manual roll of PDFium in DEPS to 
854d71c1420eb80ec79755a6cdf829f3f39aead7, to pick up the new API.

BUG=chromium:775615

Change-Id: I186a7f385eb50c59718dabc1407d49564cf3547a
Reviewed-on: https://chromium-review.googlesource.com/724021
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509839}
  • Loading branch information
zoddicus authored and Commit Bot committed Oct 18, 2017
1 parent 9c67103 commit 83f632b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ vars = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling PDFium
# and whatever else without interference from each other.
'pdfium_revision': '7c2daec0a5f5d5e0f442db7946e9356daa7c55b2',
'pdfium_revision': '854d71c1420eb80ec79755a6cdf829f3f39aead7',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling openmax_dl
# and whatever else without interference from each other.
Expand Down
10 changes: 2 additions & 8 deletions pdf/pdfium/fuzzers/pdfium_xfa_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@

#include "pdf/pdfium/fuzzers/pdfium_fuzzer_helper.h"

// TODO(mmoroz,rharrison): remove this after landing of
// https://chromium-review.googlesource.com/c/chromium/src/+/724021
#ifndef DOCTYPE_PDF
#define DOCTYPE_PDF 0
#endif

class PDFiumXFAFuzzer : public PDFiumFuzzerHelper {
public:
PDFiumXFAFuzzer() : PDFiumFuzzerHelper() {}
Expand All @@ -20,8 +14,8 @@ class PDFiumXFAFuzzer : public PDFiumFuzzerHelper {
// Return false if XFA doesn't load as otherwise we're duplicating the work
// done by the non-xfa fuzzer.
bool OnFormFillEnvLoaded(FPDF_DOCUMENT doc) override {
int doc_type = DOCTYPE_PDF;
if (!FPDF_HasXFAField(doc, &doc_type) || doc_type == DOCTYPE_PDF)
int form_type = FPDF_GetFormType(doc);
if (form_type != FORMTYPE_XFA_FULL && form_type != FORMTYPE_XFA_FOREGROUND)
return false;
return FPDF_LoadXFA(doc);
}
Expand Down

0 comments on commit 83f632b

Please sign in to comment.