jsvana / async-minecraft-ping

ServerListPing in Rust
Apache License 2.0
13 stars 5 forks source link

Don't die when length is invalid(0) #10

Closed scd31 closed 3 years ago

scd31 commented 3 years ago

It's possible for the returned length to be 0. I don't fully understand why this happens(I don't fully understand the codebase) but the result is an overflow error on line 212 in debug mode, or attempting to allocate a huge array in release mode. This adds a quick check and bails if the length is invalid.