From 90a24741e79cbf20d4456050f0fe39c3f88f5246 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Tue, 16 May 2023 19:52:56 +0200 Subject: [PATCH] fuzz: add a new, more efficient, descriptor parsing target This new target focuses on fuzzing the actual descriptor parsing logic by not requiring the fuzzer to produce valid keys (nor a valid checksum for that matter). This should make it much more efficient to find bugs we could introduce moving forward. Using a character as a marker (here '%') to be able to search and replace in the string without having to mock the actual descriptor parsing logic was an insight from Pieter Wuille. --- src/test/fuzz/descriptor_parse.cpp | 116 +++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/src/test/fuzz/descriptor_parse.cpp b/src/test/fuzz/descriptor_parse.cpp index 0e4ef1522f..0d3e422ff7 100644 --- a/src/test/fuzz/descriptor_parse.cpp +++ b/src/test/fuzz/descriptor_parse.cpp @@ -3,11 +3,110 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include