summaryrefslogtreecommitdiff
path: root/testing/fuzzers
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-08-13 23:19:29 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-13 23:19:29 +0000
commited176992eb7ddbb0fee7b79625501df06f8ccf93 (patch)
treeab5493b058e80da342648fda8b0cc8a8ba6cab94 /testing/fuzzers
parentf0260b2cccb9e6c59413a20040dccf5551fb6882 (diff)
downloadpdfium-ed176992eb7ddbb0fee7b79625501df06f8ccf93.tar.xz
Make CFX_ReadOnlyMemoryStream take a span.
Change-Id: Id097320ab2d9b5d1579582e5797e29c701499501 Reviewed-on: https://pdfium-review.googlesource.com/39991 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'testing/fuzzers')
-rw-r--r--testing/fuzzers/pdf_xml_fuzzer.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/testing/fuzzers/pdf_xml_fuzzer.cc b/testing/fuzzers/pdf_xml_fuzzer.cc
index 7f5fdb1532..efc171671c 100644
--- a/testing/fuzzers/pdf_xml_fuzzer.cc
+++ b/testing/fuzzers/pdf_xml_fuzzer.cc
@@ -13,13 +13,15 @@
#include "core/fxcrt/xml/cfx_xmlelement.h"
#include "core/fxcrt/xml/cfx_xmlparser.h"
#include "third_party/base/ptr_util.h"
+#include "third_party/base/span.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
FX_SAFE_SIZE_T safe_size = size;
if (!safe_size.IsValid())
return 0;
- auto stream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(data, size);
+ auto stream = pdfium::MakeRetain<CFX_ReadOnlyMemoryStream>(
+ pdfium::make_span(data, size));
CFX_XMLParser parser(stream);
std::unique_ptr<CFX_XMLDocument> doc = parser.Parse();
if (!doc || !doc->GetRoot())