Skip to content

Commit a278e96

Browse files
committed
Don't attempt to parse empty packets
This _should_ be a no-op.
1 parent 4e2fbe5 commit a278e96

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/packet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<R: Read> PacketReader<R> {
8585
self.start = self.bytes.len() - self.remaining;
8686

8787
loop {
88-
{
88+
if self.remaining != 0 {
8989
let bytes = {
9090
// NOTE: this is all sorts of unfortunate. what we really want to do is to give
9191
// &self.bytes[self.start..] to `packet()`, and the lifetimes should all work

0 commit comments

Comments
 (0)