Sfoglia il codice sorgente

ensure buffer is completely filled in

Darien Raymond 8 anni fa
parent
commit
cf080e8061
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      common/crypto/chunk.go

+ 1 - 1
common/crypto/chunk.go

@@ -73,7 +73,7 @@ func (r *ChunkStreamReader) readSize() (uint16, error) {
 			return 0, err
 		}
 	}
-	common.Must2(r.leftOver.Read(r.buffer))
+	common.Must2(io.ReadFull(&r.leftOver, r.buffer))
 	return r.sizeDecoder.Decode(r.buffer)
 }