diff options
| author | Old-Ding <[email protected]> | 2026-07-07 09:14:47 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2026-07-07 19:55:21 +0800 |
| commit | 50c6853d38125d887aeeb8b0825207af605b0d97 (patch) | |
| tree | fd743acdb07cfaf32d2bb2196f65fa68e533d4c0 /components | |
| parent | ee43eeb68577edeb56d2582d657b31e4e29243fb (diff) | |
rt-link: reject frame offset at frame limit
The receive sequence filter maps incoming data-frame sequence numbers to zero-based frame offsets. RT_LINK_FRAMES_MAX is the maximum number of split frames, so valid offsets are 0 through RT_LINK_FRAMES_MAX - 1.
Reject offset == RT_LINK_FRAMES_MAX before frame handling instead of letting it reach long-frame assembly.
Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <[email protected]>
Diffstat (limited to 'components')
| -rw-r--r-- | components/utilities/rt-link/src/rtlink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/utilities/rt-link/src/rtlink.c b/components/utilities/rt-link/src/rtlink.c index db69160128..656dae1005 100644 --- a/components/utilities/rt-link/src/rtlink.c +++ b/components/utilities/rt-link/src/rtlink.c @@ -767,7 +767,7 @@ static void rt_link_frame_check(void) { /* Check the receive sequence */ offset = rt_link_check_seq(receive_frame.head.sequence, rt_link_scb->rx_record.rx_seq) - 1; - if (offset > RT_LINK_FRAMES_MAX) + if (offset >= RT_LINK_FRAMES_MAX) { /* exceptional frame, ignore it */ LOG_D("seq (%d) failed, rx_seq (%d) offset=(%d) attr= (%d) status (%d)", receive_frame.head.sequence, rt_link_scb->rx_record.rx_seq, offset, receive_frame.attribute, rt_link_scb->state); |
