Haivision / srt

Secure, Reliable, Transport
https://www.srtalliance.org
Mozilla Public License 2.0
3.08k stars 840 forks source link

[BUG] Static Global State Variables Used for Multiple Connections #3035

Open jlsantiago0 opened 2 hours ago

jlsantiago0 commented 2 hours ago

If you use the SRT library with multiple SRT connections in it. The global static state variables in srt/haicrypt/hcrypt_xpt_srt.c are used by all encrypted SRT connections. For instance if you have an application that is inputing and encrypted SRT stream and outputing an encrypted SRT stream. The following global static state variables are used by all of them at the same time:

srt/haicrypt/hcrypt_xpt_srt.c :

// Line: 68
static hcrypt_MsgInfo _hcMsg_SRT_MsgInfo;
// Line: 156
static hcrypt_MsgInfo _hcMsg_SRT_MsgInfo;

This can be observed with the srt-live-transmit application where you ijnput an ecrypted SRT source stream and output and encrypted SRT stream.

jlsantiago0 commented 2 hours ago

NOTE: These variables are collapsed into a single common global variable. Since they have the same name. Even if they had different names, there would also be interference.