Skip to content

Commit

Permalink
Ignore small packets
Browse files Browse the repository at this point in the history
  • Loading branch information
jkcoxson committed Apr 15, 2022
1 parent c7e4ef6 commit 28c66da
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ async fn main() {
if size == 0 {
return;
}
if size < 20 {
// Probably a bad packet
return;
}
let buffer = &buf[0..size];

let parsed: raw_packet::RawPacket = buffer.into();
Expand Down

0 comments on commit 28c66da

Please sign in to comment.