#include <vlc_network.h>
#include <vlc_charset.h>
#include <vlc_strings.h>
+#include <vlc_rand.h>
#ifndef WIN32
# include <locale.h>
answer->p_body = NULL;
break;
}
- if( asprintf( &psz_new, "%d", rand() ) < 0 )
+#warning Should use secure randomness here! (spoofing risk)
+ if( asprintf( &psz_new, "%lu", vlc_mrand48() ) < 0 )
return VLC_ENOMEM;
psz_session = psz_new;
answer->p_body = NULL;
break;
}
- if( asprintf( &psz_new, "%d", rand() ) < 0 )
+#warning Session ID should be securely random (spoofing risk)
+ if( asprintf( &psz_new, "%lu", vlc_mrand48() ) < 0 )
return VLC_ENOMEM;
psz_session = psz_new;