Skip to content

Commit 241cec9

Browse files
committed
compare with signed Int for 32-bit Arm
Signed-off-by: Samuel Karp <samuelkarp@google.com>
1 parent 21c3864 commit 241cec9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

spdy/write.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func writeControlFrameHeader(w io.Writer, h ControlFrameHeader) error {
164164
func writeHeaderValueBlock(w io.Writer, h http.Header) (n int, err error) {
165165
n = 0
166166
numHeaders := len(h)
167-
if numHeaders > math.MaxUint32 {
167+
if numHeaders > math.MaxInt32 {
168168
return n, &Error{InvalidControlFrame, 0}
169169
}
170170
if err = binary.Write(w, binary.BigEndian, uint32(numHeaders)); err != nil {
@@ -173,7 +173,7 @@ func writeHeaderValueBlock(w io.Writer, h http.Header) (n int, err error) {
173173
n += 4
174174
for name, values := range h {
175175
nameLen := len(name)
176-
if nameLen > math.MaxUint32 {
176+
if nameLen > math.MaxInt32 {
177177
return n, &Error{InvalidControlFrame, 0}
178178
}
179179
if err = binary.Write(w, binary.BigEndian, uint32(nameLen)); err != nil {
@@ -187,7 +187,7 @@ func writeHeaderValueBlock(w io.Writer, h http.Header) (n int, err error) {
187187
n += nameLen
188188
v := strings.Join(values, headerValueSeparator)
189189
vLen := len(v)
190-
if vLen > math.MaxUint32 {
190+
if vLen > math.MaxInt32 {
191191
return n, &Error{InvalidControlFrame, 0}
192192
}
193193
if err = binary.Write(w, binary.BigEndian, uint32(vLen)); err != nil {

0 commit comments

Comments
 (0)