Unverified Commit 3175340d authored by Steven Allen's avatar Steven Allen Committed by GitHub

Merge pull request #44 from libp2p/fix/oversize-read

fix buffer size check
parents 4d58713c 98b8bd9f
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment