[#216] netmap: Add policy decode fuzz test

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-05-02 17:13:08 +03:00 committed by Evgenii Stratonikov
parent 99e02858af
commit 02c936f397
5 changed files with 48 additions and 16 deletions

14
netmap/policy_fuzz.go Normal file
View file

@ -0,0 +1,14 @@
//go:build gofuzz
// +build gofuzz
package netmap
func DoFuzzPlacementPolicyDecode(data []byte) int {
p := string(data)
if p == "" {
return 0
}
var pp PlacementPolicy
_ = pp.DecodeString(p)
return 1
}