|
BDE 4.39.x Production Release
|
Provide fuzz test utilities for bdlat-types.
Provide fuzz test utilities for bdlat-types.
This component provides a namespace, bdlat::FuzzUtil, containing functions that create bdlat message types from fuzz data provided by a fuzz harness (e.g., libFuzzer).
Effectively, given a random sequence of bytes provided by a fuzz harness, like libFuzzer, this component can be used to populate a bdlat-compatible message with arbitrary data determined by that random sequence. This can be used to fuzz test an interface (like a service interface) taking a bdlat-compatible message. See the BDE fuzz-testing guide for more detail.
This section illustrates intended use of this component.
Suppose we have a message type MyMessage and we wish to fuzz test it.
We have to provide a function like this for libFuzzer:
After the FuzzUtil::consumeMessage call, the msg object contains a well-formed message, which can then be serialized or processed in another way.