Fix null crash in CheckTrailer.
authorTom Sepez <tsepez@chromium.org>
Fri, 23 Jan 2015 23:05:43 +0000 (15:05 -0800)
committerTom Sepez <tsepez@chromium.org>
Fri, 23 Jan 2015 23:05:43 +0000 (15:05 -0800)
commite0bbe4aac90e56950f28e322c3d6192c35af5ea0
tree55cc9af3afa38333b13a55810d85cd788e6196f8
parentaf9be4fe77e1067f1cc265de8aae547f6358bc44
Fix null crash in CheckTrailer.

We are making checks in the incorrect order.  Also adds two test
cases, one for the this crash, and another for the original issue
that motivated the patch.

Original Patch by Bo at https://codereview.chromium.org/866003003/

BUG=450871
R=bo_xu@foxitsoftware.com

Review URL: https://codereview.chromium.org/872563002
BUILD.gn
core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
fpdfsdk/src/fpdf_dataavail_unittest.cpp [new file with mode: 0644]
pdfium.gyp
testing/embedder_test.h
testing/resources/trailer_as_hexstring.in [new file with mode: 0644]
testing/resources/trailer_as_hexstring.pdf [new file with mode: 0644]
testing/resources/trailer_unterminated.in [new file with mode: 0644]
testing/resources/trailer_unterminated.pdf [new file with mode: 0644]