diff --git a/traversal/selector/matcher.go b/traversal/selector/matcher.go index 38314db4..4186221f 100644 --- a/traversal/selector/matcher.go +++ b/traversal/selector/matcher.go @@ -55,7 +55,7 @@ func (s Slice) Slice(n datamodel.Node) (datamodel.Node, error) { return nil, err } - sr := io.NewSectionReader(readerat{rdr}, s.From, s.To) + sr := io.NewSectionReader(readerat{rdr}, s.From, s.To-s.From) return basicnode.NewBytesFromReader(sr), nil } bytes, err := n.AsBytes()