Merge commit from fork

`get_rtt_red_seq()` stored one entry per RFC 2198 redundancy header
in the fixed `pt[]` and `len[]` arrays without checking the count
against `MAX_RED_FRAMES`, so a packet with more headers wrote past
them. Reject the packet once the count reaches `MAX_RED_FRAMES`, and
reject a frame index at or above it, which a sequence number wrap
can produce.
This commit is contained in:
Dmitry Verenitsin authored and GitHub committed 2026-11-18 20:22:48 +03:00
1 parent 82adc771cb
commit dec8abf635
1 file changed
+2 -2
+2 -2
View File
@@ -2651,7 +2651,7 @@ static int get_rtt_red_seq(int want_seq, void *data, switch_size_t datalen, int
*(buf + datalen) = '\0';
while (*buf & 0x80) {
if (buf + 3 > e) {
if (buf + 3 > e || count >= MAX_RED_FRAMES) {
*new_datalen = 0;
return 0;
}
@@ -2666,7 +2666,7 @@ static int get_rtt_red_seq(int want_seq, void *data, switch_size_t datalen, int
idx = count - (seq - want_seq);
if (idx < 0) {
if (idx < 0 || idx >= MAX_RED_FRAMES) {
*new_datalen = 0;
return 0;
}