Skip to content

Conversation

@djchhp
Copy link
Contributor

@djchhp djchhp commented Jan 14, 2026

Check the length of CAN device interface names before copying them to the Linux internal strcutures. This avoids a potential buffer overflow error.

Describe your changes

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

Check the length of CAN device interface names before copying them to
the Linux internal strcutures. This avoids a potential buffer overflow error.

Signed-off-by: Jan Christoph Habig <[email protected]>
// The name can occupy the fill buffer. If it does not, nulltermination is necessary
// Since most Linux systems enforce 15 chars as limit plus 1 for nulltermination
// we do the same thing here.
if(can_device.size() >= IFNAMSIZ){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit regarding style. Please place a space after the "if".

@hikinggrass hikinggrass added the bug Something isn't working label Jan 14, 2026
fix style

Signed-off-by: Jan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants