From c135ec2f6a34116f63ebbdfde25001b21d560f24 Mon Sep 17 00:00:00 2001 From: Arjun Singh Date: Sun, 1 Oct 2023 14:53:58 +0530 Subject: fuzzing : fuzz testing support for oss-fuzz integration Signed-off-by: Arjun Singh --- plumbing/protocol/packp/uppackresp_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plumbing/protocol') diff --git a/plumbing/protocol/packp/uppackresp_test.go b/plumbing/protocol/packp/uppackresp_test.go index 8fbf924..ec56507 100644 --- a/plumbing/protocol/packp/uppackresp_test.go +++ b/plumbing/protocol/packp/uppackresp_test.go @@ -3,6 +3,7 @@ package packp import ( "bytes" "io" + "testing" "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/protocol/packp/capability" @@ -128,3 +129,14 @@ func (s *UploadPackResponseSuite) TestEncodeMultiACK(c *C) { b := bytes.NewBuffer(nil) c.Assert(res.Encode(b), NotNil) } + +func FuzzDecoder(f *testing.F) { + + f.Fuzz(func(t *testing.T, input []byte) { + req := NewUploadPackRequest() + res := NewUploadPackResponse(req) + defer res.Close() + + res.Decode(io.NopCloser(bytes.NewReader(input))) + }) +} -- cgit