sipsorcery-org / sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.
https://sipsorcery-org.github.io/sipsorcery
Other
1.39k stars 424 forks source link

`IndexOutOfRangeException` while parsing compound packet with receiver report #1109

Closed lostmsu closed 2 months ago

lostmsu commented 2 months ago

Here's a base64-encoded packet that I am getting from Edge 124.0.2478.51:

gckABwAAAAGfvN/15WEmulWNt6eaZCGYnQkoe6/3r3X0yccpQ/6TxLt6d7mhu0hGSig40fvf6taAAAGeYM+XEbo46a3DJg==

This guy fails in ReceptionReportSample constructor with IndexOutOfRangeException

Example test code:

// regression test for https://github.com/sipsorcery-org/sipsorcery/issues/1109
[Fact]
public void ParseIndexOutOfRange1109()
{
    byte[] buffer = Convert.FromBase64String("gckABwAAAAGfvN/15WEmulWNt6eaZCGYnQkoe6/3r3X0yccpQ/6TxLt6d7mhu0hGSig40fvf6taAAAGeYM+XEbo46a3DJg==");
    var packet = new RTCPCompoundPacket(buffer);
}
lostmsu commented 2 months ago

It actually seems that this packet might not have been properly decrypted :/

See the duplicate.