From c710689a671e2a9ac43c04bc00b5766eb6578d62 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Thu, 12 Aug 2021 15:36:17 +0100 Subject: [PATCH] Call Metadatum::print() to increase fuzzing coverage. --- fuzz/fuzz-read-print-write.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/fuzz/fuzz-read-print-write.cpp b/fuzz/fuzz-read-print-write.cpp index c88f6e3d7c..03ad1f7433 100644 --- a/fuzz/fuzz-read-print-write.cpp +++ b/fuzz/fuzz-read-print-write.cpp @@ -21,6 +21,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * data, size_t size) { assert(image.get() != 0); image->readMetadata(); + for (auto& md : image->exifData()) { + md.print(&image->exifData()); + } + for (auto& md : image->iptcData()) { + md.print(&image->exifData()); + } + for (auto& md : image->xmpData()) { + md.print(&image->exifData()); + } // Print to a std::ostringstream so that the fuzzer doesn't // produce lots of garbage on stdout.