Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ static int exi_bitstream_has_overflow(exi_bitstream_t* stream)
}
{%- endif %}
}
else
{
return EXI_ERROR__BITSTREAM_OVERFLOW;
}
}

if (stream->byte_pos >= stream->data_size)
{
return EXI_ERROR__BITSTREAM_OVERFLOW;
}

return EXI_ERROR__NO_ERROR;
Expand Down
5 changes: 3 additions & 2 deletions src/input/code_templates/c/static_code/exi_v2gtp.c.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ int V2GTP20_ReadHeader(const uint8_t* stream_data, uint32_t* stream_payload_leng
}

/* check payload id */
payload_id = (stream_data[2] << 8) | stream_data[3];
payload_id = ((uint16_t)stream_data[2] << 8) | stream_data[3];
if (payload_id != v2gtp20_payload_id)
{
return V2GTP_ERROR__PAYLOAD_ID_DOES_NOT_MATCH;
}

/* determine payload length */
*stream_payload_length = (stream_data[4] << 24) | (stream_data[5] << 16) | (stream_data[6] << 8) | stream_data[7];
*stream_payload_length = ((uint32_t)stream_data[4] << 24) | ((uint32_t)stream_data[5] << 16) |
((uint32_t)stream_data[6] << 8) | stream_data[7];

return V2GTP_ERROR__NO_ERROR;
}
Expand Down