aboutsummaryrefslogtreecommitdiff
path: root/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/vendor/golang.org/x/crypto/cryptobyte/asn1.go')
-rw-r--r--src/vendor/golang.org/x/crypto/cryptobyte/asn1.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go
index 83c776de08..3a1674a1e5 100644
--- a/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go
+++ b/src/vendor/golang.org/x/crypto/cryptobyte/asn1.go
@@ -407,7 +407,12 @@ func (s *String) ReadASN1Enum(out *int) bool {
func (s *String) readBase128Int(out *int) bool {
ret := 0
for i := 0; len(*s) > 0; i++ {
- if i == 4 {
+ if i == 5 {
+ return false
+ }
+ // Avoid overflowing int on a 32-bit platform.
+ // We don't want different behavior based on the architecture.
+ if ret >= 1<<(31-7) {
return false
}
ret <<= 7