Skip to content

Commit

Permalink
fix: check err from pkgReader.Seek
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang committed Nov 11, 2024
1 parent df70b41 commit e988817
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/deb/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ func extractData(pkgReader io.ReadSeeker, options *ExtractOptions) error {

// Second pass to create hard links
if len(pendingHardlinks) > 0 {
pkgReader.Seek(0, io.SeekStart)
newOffset, err := pkgReader.Seek(0, io.SeekStart)
if err != nil {
return err
}
if newOffset != 0 {
return fmt.Errorf("cannot seek to the beginning of the package")
}
dataReader, err = getDataReader(pkgReader)
if err != nil {
return err
Expand Down

0 comments on commit e988817

Please sign in to comment.