Skip to content

fix: skip truncated a=rtcp SDP lines in ExtractCID - #361

Merged
adubovikov merged 3 commits into
masterfrom
fix-360-extractcid-rtcp-bounds
Sep 4, 2026
Merged

adubovikov merged 3 commits into
masterfrom
fix-360-extractcid-rtcp-bounds

Conversation

@adubovikov

Copy link
Copy Markdown
Member

Summary

  • Guard ExtractCID() before slicing the address out of a=rtcp:<port> IN IPx … so a truncated SDP line no longer panics with slice bounds out of range.
  • Keep the explicit RTCP port from a=rtcp: and fall back to the session c= IP when the address is missing.
  • Add regression tests for malformed IPv4/IPv6 lines, a valid a=rtcp: with address, and port-only form.

Fixes #360

Test plan

  • go test -count=1 -run TestExtractCID ./src/decoder/
  • go test -race -count=1 -run TestExtractCID ./src/decoder/
  • Confirm a live capture with a truncated a=rtcp:12345 IN IP4 SDP no longer crashes heplify

Malformed "a=rtcp:<port> IN IPx" lines without an address caused a
slice-bounds panic. Check the IP start index before slicing (#360).
@adubovikov
adubovikov requested a review from kYroL01 September 4, 2026 08:42
@adubovikov
adubovikov merged commit eb32d4e into master Sep 4, 2026
7 checks passed
@adubovikov
adubovikov deleted the fix-360-extractcid-rtcp-bounds branch September 4, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

heplify: panic: runtime error: slice bounds out of range [20:19] in ExtractCID() when parsing malformed "a=rtcp:" SDP line

2 participants