Repository navigation
fix: return error on packet length overflow in TransportLayerCC and CCFeedbackReport - #235
Open
AdamMagued wants to merge 1 commit into
Open
AdamMagued wants to merge 1 commit into
AdamMagued wants to merge 1 commit into
Conversation
Return errPacketTooLarge when TransportLayerCC or CCFeedbackReport length overflows the uint16 RTCP header length limit. Also update TransportLayerCC.packetLen to return an int to prevent wrapping. Signed-off-by: Adam Magued <adamismailmageud@gmail.com>
AdamMagued
force-pushed
the
fix/issue-234-marshal-overflow-packet-too-large
branch
from
October 17, 2026 03:56
b51175d to
767fa86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #234
Problem
In
TransportLayerCCandCCFeedbackReport,Marshalcalculates the packet length in 32-bit words and casts it to auint16. When a packet contains a large number of deltas or feedback metric blocks such that the payload exceedsmath.MaxUint16words, the integer wraps around. This causes the allocated buffer to be undersized, triggering apanic: runtime error: slice bounds out of rangeduring marshaling.Solution
TransportLayerCC.Marshal/MarshalToandCCFeedbackReport.Marshal/MarshalToreturningerrPacketTooLargewhen the packet size cannot fit within the RTCP length field.transport_layer_cc_test.goandrfc8888_test.goverifying that oversized packets return an error gracefully rather than panicking.Verified via container sandbox test suite.