[vlc-devel] [PATCH 1/2] rtsp: ensure session ID is at least 8 bytes

Alexandre Janniaux ajanni at videolabs.io
Thu Sep 5 19:43:44 CEST 2019


---
 modules/stream_out/rtsp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/stream_out/rtsp.c b/modules/stream_out/rtsp.c
index 6161f6a795..3053dff3c6 100644
--- a/modules/stream_out/rtsp.c
+++ b/modules/stream_out/rtsp.c
@@ -808,8 +808,9 @@ static int RtspHandler( rtsp_stream_t *rtsp, rtsp_stream_id_t *id,
 
                     if( psz_session == NULL )
                     {
-                        /* Create a dummy session ID */
-                        snprintf( psz_sesbuf, sizeof( psz_sesbuf ), "%lu",
+                        /* Create a dummy session ID. We use it for RTP so make
+                         * sure the length is at least 8 bytes. */
+                        snprintf( psz_sesbuf, sizeof( psz_sesbuf ), "%" PRIu64,
                                   vlc_mrand48() );
                         psz_session = psz_sesbuf;
                     }
-- 
2.23.0



More information about the vlc-devel mailing list