Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #44 from libp2p/fix/oversize-read
Browse files Browse the repository at this point in the history
fix buffer size check
  • Loading branch information
Stebalien authored Apr 28, 2019
2 parents 4d58713 + 98b8bd9 commit 3175340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rw.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (r *etmReader) Read(buf []byte) (int, error) {

// If the destination buffer is too short, fill an internal buffer and then
// drain as much of that into the output buffer as will fit.
if cap(buf) < fullLen {
if len(buf) < fullLen {
err := r.fill()
if err != nil {
return 0, err
Expand Down

0 comments on commit 3175340

Please sign in to comment.