From 845810d94df83747634a60ff59635a670bba1124 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 | 115 +++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/src/test/fuzz/descriptor_parse.cpp b/src/test/fuzz/descriptor_parse.cpp index 99bacb9bfe8ca..4091e8667bce6 100644 --- a/src/test/fuzz/descriptor_parse.cpp +++ b/src/test/fuzz/descriptor_parse.cpp @@ -3,11 +3,109 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include