Commit 10cfc926 authored by Christophe Massiot's avatar Christophe Massiot

Check input buffer size in en50221_SendMMIObject()

parent e93aee8d
......@@ -2396,6 +2396,12 @@ uint8_t en50221_SendMMIObject( uint8_t *p_buffer, ssize_t i_size )
int i_session_id, i_slot;
struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)p_buffer;
if ( i_size < sizeof(struct cmd_mmi_send))
{
msg_Err( NULL, "command packet too short (%zd)\n", i_size );
return RET_HUH;
}
if ( en50221_UnserializeMMIObject( &p_cmd->object, i_size -
((void *)&p_cmd->object - (void *)p_cmd) ) == -1 )
return RET_ERR;
......
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