]> git.sesse.net Git - vlc/commitdiff
Improve randomness of RTSP session ID.
authorRémi Denis-Courmont <rem@videolan.org>
Sat, 1 Sep 2007 17:34:39 +0000 (17:34 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sat, 1 Sep 2007 17:34:39 +0000 (17:34 +0000)
Now it should not be possible to guess other people's ID.

modules/stream_out/rtsp.c

index 0979fffcf038ef5154f59fb16d1c225c43fb52da..a09e67406c153625b86b317b7448b311957f1834 100644 (file)
@@ -32,6 +32,7 @@
 #include <vlc_httpd.h>
 #include <vlc_url.h>
 #include <vlc_network.h>
+#include <vlc_rand.h>
 #include <assert.h>
 #include <errno.h>
 #include <stdlib.h>
@@ -248,7 +249,7 @@ rtsp_session_t *RtspClientNew( rtsp_stream_t *rtsp )
         return NULL;
 
     s->stream = rtsp;
-    s->id = rand(); /* FIXME: not enough entropy */
+    vlc_rand_bytes (&s->id, sizeof (s->id));
     s->trackc = 0;
     s->trackv = NULL;