aboutsummaryrefslogtreecommitdiff
path: root/src/structs.rs
diff options
context:
space:
mode:
authorJan Niehusmann <[email protected]>2022-08-30 20:36:57 +0000
committerJan Niehusmann <[email protected]>2022-08-30 20:37:02 +0000
commitacaa8b3e8b80ccd49e04a6dc7d595d3a52d1ad0d (patch)
tree49f718ce3ec80d8f99059842597fce52023f87fa /src/structs.rs
parent69e92e5639e0a86994c9bdf647a0f2d57f768898 (diff)
Fix calculation of slice index
total_len is already rounded up, so the `+ 3` is not needed. And even if it was, the calculation should have been `((total_len + 3) / 4)`. `(total_len + 3 / 4)` is equivalent to `total_len` and can overflow the slice, leading to a panic which can easily be triggered by sending large ICMP ECHO packets to the device.
Diffstat (limited to 'src/structs.rs')
0 files changed, 0 insertions, 0 deletions