aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/tree_test.go
diff options
context:
space:
mode:
authorPaulo Gomes <pjbgf@linux.com>2023-10-03 21:24:30 +0100
committerGitHub <noreply@github.com>2023-10-03 21:24:30 +0100
commitced662e9db6667069a5255446425ec40d388f7e1 (patch)
tree9841d964156160119c2455a461c4c0a392a1b43d /plumbing/object/tree_test.go
parent52c2972976737a00fce91d7deb1278a6a460cae6 (diff)
parentc135ec2f6a34116f63ebbdfde25001b21d560f24 (diff)
downloadgo-git-ced662e9db6667069a5255446425ec40d388f7e1.tar.gz
Merge pull request #855 from 0x34d/fuzzing
fuzzing : fuzz testing support for oss-fuzz integration
Diffstat (limited to 'plumbing/object/tree_test.go')
-rw-r--r--plumbing/object/tree_test.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/plumbing/object/tree_test.go b/plumbing/object/tree_test.go
index d9dad47..bb5fc7a 100644
--- a/plumbing/object/tree_test.go
+++ b/plumbing/object/tree_test.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"io"
+ "testing"
fixtures "github.com/go-git/go-git-fixtures/v4"
"github.com/go-git/go-git/v5/plumbing"
@@ -1623,3 +1624,19 @@ func (s *TreeSuite) TestTreeDecodeReadBug(c *C) {
c.Assert(err, IsNil)
c.Assert(entriesEquals(obtained.Entries, expected.Entries), Equals, true)
}
+
+func FuzzDecode(f *testing.F) {
+
+ f.Fuzz(func(t *testing.T, input []byte) {
+
+ obj := &SortReadObject{
+ t: plumbing.TreeObject,
+ h: plumbing.ZeroHash,
+ cont: input,
+ sz: int64(len(input)),
+ }
+
+ newTree := &Tree{}
+ newTree.Decode(obj)
+ })
+}