From ad9ac6d07ce1819260c2b7f090fd4fe742c80d9f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 10 Jul 2022 23:49:07 -0600 Subject: Fuzz btrfsitem, and by consequence improve binstruct errors --- lib/btrfs/btrfsitem/item_extent.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/btrfs/btrfsitem/item_extent.go') diff --git a/lib/btrfs/btrfsitem/item_extent.go b/lib/btrfs/btrfsitem/item_extent.go index 9257d2b..d49243d 100644 --- a/lib/btrfs/btrfsitem/item_extent.go +++ b/lib/btrfs/btrfsitem/item_extent.go @@ -74,8 +74,8 @@ type ExtentHeader struct { type TreeBlockInfo struct { Key internal.Key `bin:"off=0, siz=0x11"` - Level uint8 `bin:"off=0x11, siz=0x8"` - binstruct.End `bin:"off=0x19"` + Level uint8 `bin:"off=0x11, siz=0x1"` + binstruct.End `bin:"off=0x12"` } type ExtentFlags uint64 @@ -131,7 +131,7 @@ func (o *ExtentInlineRef) UnmarshalBinary(dat []byte) (int, error) { return n, err } default: - return n, fmt.Errorf("btrfsitem.ExtentInlineRef.UnmarshalBinary: unexpected item type %v", o.Type) + return n, fmt.Errorf("unexpected item type %v", o.Type) } return n, nil } @@ -163,7 +163,7 @@ func (o ExtentInlineRef) MarshalBinary() ([]byte, error) { return dat, err } default: - return dat, fmt.Errorf("btrfsitem.ExtentInlineRef.MarshalBinary: unexpected item type %v", o.Type) + return dat, fmt.Errorf("unexpected item type %v", o.Type) } return dat, nil } -- cgit v1.2.3-2-g168b