summaryrefslogtreecommitdiff
path: root/testing/libfuzzer/pdf_hint_table_fuzzer.cc
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-09 18:30:24 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-09 18:30:24 +0000
commit53894390dba2ec571bab75157ebe60d11171ed07 (patch)
treea2187a69fdc5167be060c621370a6c7c84ebf2e3 /testing/libfuzzer/pdf_hint_table_fuzzer.cc
parentd45f9980995af5c6e4c68e32df89d3cccb0231ef (diff)
downloadpdfium-53894390dba2ec571bab75157ebe60d11171ed07.tar.xz
Use pdfium::span<> in CFX_BitStream, CPDF_SimpleParser.
Get bounds checks in parsers automatically when using spans. Change-Id: I71fbe7b838435d455376db2f89817d807a9cdcfd Reviewed-on: https://pdfium-review.googlesource.com/29830 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'testing/libfuzzer/pdf_hint_table_fuzzer.cc')
-rw-r--r--testing/libfuzzer/pdf_hint_table_fuzzer.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/testing/libfuzzer/pdf_hint_table_fuzzer.cc b/testing/libfuzzer/pdf_hint_table_fuzzer.cc
index ee51e25f24..50ca5cd693 100644
--- a/testing/libfuzzer/pdf_hint_table_fuzzer.cc
+++ b/testing/libfuzzer/pdf_hint_table_fuzzer.cc
@@ -12,6 +12,7 @@
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fxcrt/cfx_bitstream.h"
#include "third_party/base/ptr_util.h"
+#include "third_party/base/span.h"
int32_t GetData(const int32_t** data32, const uint8_t** data, size_t* size) {
const int32_t* ret = *data32;
@@ -36,7 +37,7 @@ class HintTableForFuzzing : public CPDF_HintTables {
if (size < static_cast<size_t>(shared_hint_table_offset_))
return;
- CFX_BitStream bs(data, size);
+ CFX_BitStream bs(pdfium::make_span(data, size));
if (!ReadPageHintTable(&bs))
return;
ReadSharedObjHintTable(&bs, shared_hint_table_offset_);