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

update: correct check for update file size

parent 0bdd0e63
...@@ -192,9 +192,8 @@ static bool GetUpdateFile( update_t *p_update ) ...@@ -192,9 +192,8 @@ static bool GetUpdateFile( update_t *p_update )
goto error; goto error;
} }
const int64_t i_read = stream_Size( p_stream ); uint64_t i_read;
if( stream_GetSize( p_stream, &i_read ) || i_read >= UINT16_MAX )
if( i_read < 0 || i_read >= UINT16_MAX)
{ {
msg_Err(p_update->p_libvlc, "Status file too large"); msg_Err(p_update->p_libvlc, "Status file too large");
goto error; goto error;
...@@ -204,7 +203,7 @@ static bool GetUpdateFile( update_t *p_update ) ...@@ -204,7 +203,7 @@ static bool GetUpdateFile( update_t *p_update )
if( !psz_update_data ) if( !psz_update_data )
goto error; goto error;
if( stream_Read( p_stream, psz_update_data, i_read ) != i_read ) if( stream_Read( p_stream, psz_update_data, i_read ) != (ssize_t)i_read )
{ {
msg_Err( p_update->p_libvlc, "Couldn't download update file %s", msg_Err( p_update->p_libvlc, "Couldn't download update file %s",
UPDATE_VLC_STATUS_URL ); UPDATE_VLC_STATUS_URL );
......
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