Skip to content

Fix size calculations to prevent overflowing fake_eth_hdr in IP layer mode#775

Merged
zakird merged 2 commits intozmap:mainfrom
droe:droe/fix-fake_eth_hdr-overflow
Feb 11, 2024
Merged

Fix size calculations to prevent overflowing fake_eth_hdr in IP layer mode#775
zakird merged 2 commits intozmap:mainfrom
droe:droe/fix-fake_eth_hdr-overflow

Conversation

@droe
Copy link
Contributor

@droe droe commented Feb 10, 2024

  • Avoid writing more than sizeof(fake_eth_hdr) - sizeof(struct ether_header) bytes to &fake_eth_hdr[sizeof(struct ether_header)], avoiding overflow of fake_eth_hdr
  • Ensure buflen matches effective amount of data in bytes after pointing bytes to fake_eth_hdr

Should fix #580.

@zakird zakird merged commit befe4c0 into zmap:main Feb 11, 2024
@droe droe deleted the droe/fix-fake_eth_hdr-overflow branch March 11, 2024 08:01
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.

segmentation fault when sending IP layer packets

2 participants