forked from security/hakurei
internal/pipewire: increment remote sequence after establishing bounds
This avoids incrementing it twice proceeding from a partial message. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -681,11 +681,11 @@ func (ctx *Context) consume(receiveRemaining []byte) (remaining []byte, err erro
|
|||||||
if header.Sequence != ctx.remoteSequence {
|
if header.Sequence != ctx.remoteSequence {
|
||||||
return remaining, UnexpectedSequenceError(header.Sequence)
|
return remaining, UnexpectedSequenceError(header.Sequence)
|
||||||
}
|
}
|
||||||
ctx.remoteSequence++
|
|
||||||
|
|
||||||
if len(remaining) < int(SizeHeader+header.Size) {
|
if len(remaining) < int(SizeHeader+header.Size) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ctx.remoteSequence++
|
||||||
|
|
||||||
proxy, ok := ctx.proxy[header.ID]
|
proxy, ok := ctx.proxy[header.ID]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user