Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1767)

Unified Diff: testing/libfuzzer/pdf_xml_fuzzer.cc

Issue 2555373002: Use unique_ptr for CXFA_XMLParser. (Closed)
Patch Set: Alphabetize class Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/pdf_xml_fuzzer.cc
diff --git a/testing/libfuzzer/pdf_xml_fuzzer.cc b/testing/libfuzzer/pdf_xml_fuzzer.cc
index 4f000ab78e8b6cf8385560767d97ea52ced77eb6..e3cd2543449cdb28432ff0fbb031d688295355b8 100644
--- a/testing/libfuzzer/pdf_xml_fuzzer.cc
+++ b/testing/libfuzzer/pdf_xml_fuzzer.cc
@@ -56,14 +56,11 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (!stream)
return 0;
- std::unique_ptr<CFDE_XMLDoc> doc = pdfium::MakeUnique<CFDE_XMLDoc>();
- std::unique_ptr<CFDE_XMLParser, ReleaseDeleter<CFDE_XMLParser>> parser(
- new CXFA_XMLParser(doc->GetRoot(), stream));
- if (!doc->LoadXML(parser.release()))
+ auto doc = pdfium::MakeUnique<CFDE_XMLDoc>();
+ if (!doc->LoadXML(pdfium::MakeUnique<CXFA_XMLParser>(doc->GetRoot(), stream)))
return 0;
- int32_t load_result = doc->DoLoad(nullptr);
- if (load_result < 100)
+ if (doc->DoLoad(nullptr) < 100)
return 0;
(void)XFA_FDEExtension_GetDocumentNode(doc.get());
« no previous file with comments | « no previous file | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698