Skip to content

Commit

Permalink
Fix: n is not used in case of io.EOF (#97)
Browse files Browse the repository at this point in the history
When a partial read occurs and io.EOF is returned, the file_offset or
buf_idx does not advance. This appears to cause errors such as issue #71
in go-ntfs. It would be great if you could check this.
  • Loading branch information
chorogis authored Oct 30, 2024
1 parent 04736de commit a99bcb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ func (self *RangeReader) ReadAt(buf []byte, file_offset int64) (
run_offset := int(file_offset - run_file_offset)

n, err := self.readFromARun(j, buf[buf_idx:], run_offset)
if err != nil {
if err != nil && err != io.EOF {
DebugPrint("Reading offset %v from run %v returned error %v\n",
run_offset, self.runs[j].DebugString(), err)
return buf_idx, err
Expand Down

0 comments on commit a99bcb7

Please sign in to comment.