diff/apply.readCounter: check negative size
`rc.r.Read()` may return a negative `int` on an error when the reader is set to a custom content store implementation Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
		| @@ -125,6 +125,8 @@ type readCounter struct { | ||||
|  | ||||
| func (rc *readCounter) Read(p []byte) (n int, err error) { | ||||
| 	n, err = rc.r.Read(p) | ||||
| 	if n > 0 { | ||||
| 		rc.c += int64(n) | ||||
| 	} | ||||
| 	return | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Akihiro Suda
					Akihiro Suda