Commit 2e2ab20
[BUG] Reject CRcvBuffer::dropMessage range past buffer end (#3322)
dropMessage early-returns when offset_b < 0 (the entire range is
before the buffer start), but does not symmetrically guard against
offset_a >= m_szSize (the entire range is past the buffer end).
In that case start_off = offset_a is unbounded; incPos() wraps
modulo m_szSize and the loop walks legitimate buffer entries,
marking them EntryState_Drop -- corrupting receiver state from a
single malformed call.
Add a symmetric early return for offset_a >= m_szSize.
Add CRcvBufferReadMsg.PacketDropLoPastBufferEnd covering the new
guard: insert two packets, request a drop whose lo is well past
the buffer end, assert no packets were dropped and the buffered
packets are still readable.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 033d1d5 commit 2e2ab20
2 files changed
Lines changed: 30 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
299 | 327 | | |
300 | 328 | | |
301 | 329 | | |
| |||
0 commit comments