Commit 878f0a0d authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* backport [18847]

Fix out-of-bound read in switcher
parent 6f91f1d5
......@@ -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