From 30029419ad4b9e5cd382767a8645677afbeff7fd Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 13 Aug 2018 19:56:29 +0000 Subject: Use CFX_ReadOnlyMemoryStream in more places. More const pointers, less const_casts. BUG=pdfium:263 Change-Id: I47fc6d8f2f837390e40ad22d8b67946065294eaa Reviewed-on: https://pdfium-review.googlesource.com/39879 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- testing/fuzzers/pdf_xml_fuzzer.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'testing') diff --git a/testing/fuzzers/pdf_xml_fuzzer.cc b/testing/fuzzers/pdf_xml_fuzzer.cc index a3c399f78d..7f5fdb1532 100644 --- a/testing/fuzzers/pdf_xml_fuzzer.cc +++ b/testing/fuzzers/pdf_xml_fuzzer.cc @@ -6,7 +6,7 @@ #include #include -#include "core/fxcrt/cfx_memorystream.h" +#include "core/fxcrt/cfx_readonlymemorystream.h" #include "core/fxcrt/fx_safe_types.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/xml/cfx_xmldocument.h" @@ -19,9 +19,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { if (!safe_size.IsValid()) return 0; - auto stream = pdfium::MakeRetain(const_cast(data), - size, false); - + auto stream = pdfium::MakeRetain(data, size); CFX_XMLParser parser(stream); std::unique_ptr doc = parser.Parse(); if (!doc || !doc->GetRoot()) -- cgit v1.2.3