Skip to content

Commit 7fab1cb

Browse files
Fix: Prevent RELIABLE_RESET offset increase by using correct sentinel
1 parent dbbf8a6 commit 7fab1cb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/core/stream_recv.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,12 @@ QuicStreamProcessReliableResetFrame(
206206
return;
207207
}
208208

209-
if (Stream->RecvMaxLength == 0 || ReliableOffset < Stream->RecvMaxLength) {
209+
if (!Stream->Flags.RemoteCloseResetReliable || ReliableOffset < Stream->RecvMaxLength) {
210210
//
211-
// As outlined in the spec, if we receive multiple CLOSE_STREAM frames, we only accept strictly
212-
// decreasing offsets.
211+
// As outlined in the spec, if we receive multiple RELIABLE_RESET frames, we only accept strictly
212+
// decreasing offsets. Use the RemoteCloseResetReliable flag (not RecvMaxLength == 0) as the
213+
// "first frame seen" sentinel because ReliableOffset = 0 is a valid value and would otherwise
214+
// allow a subsequent frame with a larger offset to bypass this check.
213215
//
214216
Stream->RecvMaxLength = ReliableOffset;
215217
Stream->Flags.RemoteCloseResetReliable = TRUE;

0 commit comments

Comments
 (0)