Skip to content

EthernetPacketizer: do a size check on incoming bytestream#76

Open
fvalla-MTA wants to merge 1 commit intointrepidcs:masterfrom
fvalla-MTA:eth_bytestream_fix
Open

EthernetPacketizer: do a size check on incoming bytestream#76
fvalla-MTA wants to merge 1 commit intointrepidcs:masterfrom
fvalla-MTA:eth_bytestream_fix

Conversation

@fvalla-MTA
Copy link
Copy Markdown
Contributor

An incoming bytestream can be less than 24 bytes, leading to exceptions when accessing its data (or allocating the vector for its payload). Perform a size check before trying to decode the bytestream and discard invalid incoming streams.

An incoming bytestream can be less than 24 bytes, leading to exceptions
when accessing its data (or allocating the vector for its payload).
Perform a size check before trying to decode the bytestream and discard
invalid incoming streams.

Signed-off-by: Francesco Valla <francesco.valla@mta.it>
@fvalla-MTA
Copy link
Copy Markdown
Contributor Author

This solves the following error seen sporadically when using libicsneo-socketcan-daemon with a RAD-Jupiter:

terminate called after throwing an instance of 'std::length_error'
  what():  cannot create std::vector larger than max_size()
[1]    14203 IOT instruction  sudo ./libicsneo-socketcan-daemon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant