Browse Source

authority/provisioners: fix overflow on 32-bit systems

In Go, len returns signed ints, not unsigned ints; consequently, this code
comparison overflows on 32-bit systems, like ARM.
Derrick Lyndon Pallas 7 năm trước cách đây
mục cha
commit
7a5c4a1112
1 tập tin đã thay đổi với 1 bổ sung và 1 xóa
  1. 1 1
      authority/provisioners.go

+ 1 - 1
authority/provisioners.go

@@ -49,7 +49,7 @@ type uidProvisioner struct {
 }
 }
 
 
 func newSortedProvisioners(provisioners []*Provisioner) (provisionerSlice, error) {
 func newSortedProvisioners(provisioners []*Provisioner) (provisionerSlice, error) {
-	if len(provisioners) > math.MaxUint32 {
+	if len(provisioners) > math.MaxInt32 {
 		return nil, errors.New("too many provisioners")
 		return nil, errors.New("too many provisioners")
 	}
 	}