diff --git a/internal/db/fuzzer.go b/internal/db/fuzzer.go new file mode 100644 index 000000000..8501229e8 --- /dev/null +++ b/internal/db/fuzzer.go @@ -0,0 +1,14 @@ +// Copyright 2021 The Gogs Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. +// +build gofuzz + +package db + +func Fuzz(data []byte) int { + _, err := CheckPublicKeyString(string(data)) + if err != nil { + return 0 + } + return 1 +}