Skip to content

Commit d6d2b58

Browse files
committed
handle edge case (total bytes sent are too small)
1 parent 97c0443 commit d6d2b58

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/stream/gzip.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,15 @@ impl<S: Stream<Item = Result<Bytes>>> Stream for DecompressedGzipStream<S> {
239239
DeState::Writing
240240
}
241241
}
242-
None => DeState::CheckingFooter,
242+
None => {
243+
if !*this.header_read {
244+
return Poll::Ready(Some(Err(Error::new(
245+
ErrorKind::InvalidData,
246+
"A valid header was not found",
247+
))));
248+
}
249+
DeState::CheckingFooter
250+
}
243251
};
244252
continue;
245253
}

0 commit comments

Comments
 (0)