Skip to content

Commit b744574

Browse files
committed
Fix appendLengthEncodedInteger for large numbers > 0xffffff
1 parent 216197d commit b744574

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,5 +677,6 @@ func appendLengthEncodedInteger(b []byte, n uint64) []byte {
677677
case n <= 0xffffff:
678678
return append(b, 0xfd, byte(n), byte(n>>8), byte(n>>16))
679679
}
680-
return b
680+
return append(b, 0xfe, byte(n), byte(n>>8), byte(n>>16), byte(n>>24),
681+
byte(n>>32), byte(n>>40), byte(n>>48), byte(n>>56))
681682
}

0 commit comments

Comments
 (0)