Commit a85c80fb authored by Jean-Paul Saman's avatar Jean-Paul Saman

dr_40: add boundary checking

parent f84e57c6
......@@ -62,6 +62,9 @@ dvbpsi_network_name_dr_t* dvbpsi_DecodeNetworkNameDr(
/* Decode data */
p_decoded->i_name_length = p_descriptor->i_length;
if (p_decoded->i_name_length > 255)
p_decoded->i_name_length = 255;
if (p_decoded->i_name_length)
memcpy(p_decoded->i_name_byte,
p_descriptor->p_data,
......@@ -80,6 +83,9 @@ dvbpsi_descriptor_t * dvbpsi_GenNetworkNameDr(
dvbpsi_network_name_dr_t * p_decoded,
bool b_duplicate)
{
if (p_decoded->i_name_length > 255)
p_decoded->i_name_length = 255;
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x40, p_decoded->i_name_length, NULL);
......
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