archive/zip: fix casting overflow on 32-bit arch

Fixes #29555

Change-Id: Ia3c0dd65bcf94dea3f6e04c23c1fe5d6d0b2c1e9
Reviewed-on: https://go-review.googlesource.com/c/156399
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/src/archive/zip/zip_test.go b/src/archive/zip/zip_test.go
index 50218a2..3d5c759 100644
--- a/src/archive/zip/zip_test.go
+++ b/src/archive/zip/zip_test.go
@@ -159,7 +159,7 @@
 	return len(p), nil
 }
 
-func min(x, y int) int {
+func min(x, y int64) int64 {
 	if x < y {
 		return x
 	}
@@ -190,7 +190,7 @@
 	if len(parts) > 0 {
 		skipBytes := off - parts[0].off
 		for _, part := range parts {
-			repeat := min(int(part.n-skipBytes), len(p)-n)
+			repeat := int(min(part.n-skipBytes, int64(len(p)-n)))
 			memset(p[n:n+repeat], part.b)
 			n += repeat
 			if n == len(p) {