mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-26 03:38:47 +00:00
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:
1 parent
82adc771cb
commit
dec8abf635
1 file changed
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user