Commit 771953bd authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix out-of-bound read

parent 4986ab17
......@@ -649,12 +649,13 @@ static int UnpackFromFile( sout_stream_t *p_stream, const char *psz_file,
static void NetCommand( sout_stream_t *p_stream )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
char psz_buffer[10];
char psz_buffer[11];
int i_len = net_ReadNonBlock( p_stream, p_sys->i_fd, NULL, (uint8_t *)&psz_buffer[0],
sizeof( psz_buffer ), 0 );
sizeof( psz_buffer ) - 1, 0 );
if ( i_len > 0 )
{
psz_buffer[i_len] = '\0';
int i_cmd = strtol( psz_buffer, NULL, 0 );
if ( i_cmd < -1 || i_cmd > p_sys->i_nb_pictures )
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment