Skip to content

fuzzing: Detect ConsumeData function at compile time

hansmi requested to merge hansmi/usbredir:consumedata1 into master

Clang 11 and newer have a FuzzedDataProvider::ConsumeData function to fill a destination buffer. It's used to "read" input data for fuzzing the parser. Older Clang versions as included in Fedora stable don't have that function yet and require a workaround. The code contained a TODO to switch to ConsumeData once it's available everywhere. With a bit of C++ SFINAE it's possible to detect the function at compile time and only use the fallback if necessary.

Merge request reports