Skip to content

Commit

Permalink
kgo: error if RecordReader layout is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
twmb committed Nov 9, 2021
1 parent 1dc56ec commit cfb4a7f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/kgo/record_formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,10 @@ func (p *parseRecordBits) set(r parseRecordBits) { *p = *p | r }
func (p parseRecordBits) has(r parseRecordBits) bool { return p&r != 0 }

func (r *RecordReader) parseReadLayout(layout string) error {
if len(layout) == 0 {
return errors.New("RecordReader: invalid empty format")
}

var (
// If we are reading by size, we parse the layout size into one
// of these variables. When reading, we use the captured
Expand Down

0 comments on commit cfb4a7f

Please sign in to comment.