]> Sergey Matveev's repositories - btrtrc.git/blobdiff - peer_protocol/int.go
Check for chunks overflowing piece bounds on request read
[btrtrc.git] / peer_protocol / int.go
index 13bd1ca9c2027e6449a9b07d15b1a70bb2b8d791..ebcf60355fd122fd0cc55444dcd2254dc88ec310 100644 (file)
@@ -3,11 +3,18 @@ package peer_protocol
 import (
        "encoding/binary"
        "io"
+       "math"
 
        "github.com/pkg/errors"
 )
 
-type Integer uint32
+type (
+       // An alias for the underlying type of Integer. This is needed for fuzzing.
+       IntegerKind = uint32
+       Integer     IntegerKind
+)
+
+const IntegerMax = math.MaxUint32
 
 func (i *Integer) UnmarshalBinary(b []byte) error {
        if len(b) != 4 {