mirror of
https://github.com/cbeuw/Cloak.git
synced 2024-11-03 23:15:18 +00:00
Fix constant overflow
This commit is contained in:
parent
8a10949846
commit
b522d4a407
@ -97,11 +97,11 @@ func (s *Stream) recvNewFrame() {
|
|||||||
// wrapMode is true when the latest seq is wrapped but nextN is not
|
// wrapMode is true when the latest seq is wrapped but nextN is not
|
||||||
s.wrapMode = true
|
s.wrapMode = true
|
||||||
}
|
}
|
||||||
fs.trueSeq = uint64(1<<32*(s.rev+1)) + uint64(f.Seq) + 1
|
fs.trueSeq = uint64(1<<32)*uint64(s.rev+1) + uint64(f.Seq) + 1
|
||||||
// +1 because wrapped 0 should have trueSeq of 256 instead of 255
|
// +1 because wrapped 0 should have trueSeq of 256 instead of 255
|
||||||
// when this bit was run on 1, the trueSeq of 1 would become 256
|
// when this bit was run on 1, the trueSeq of 1 would become 256
|
||||||
} else {
|
} else {
|
||||||
fs.trueSeq = uint64(1<<32*s.rev) + uint64(f.Seq)
|
fs.trueSeq = uint64(1<<32)*uint64(s.rev) + uint64(f.Seq)
|
||||||
// when this bit was run on 255, the trueSeq of 255 would be 255
|
// when this bit was run on 255, the trueSeq of 255 would be 255
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user