Don't unwrap on bad zstd data (#27891)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-04-01 20:09:18 -06:00 committed by GitHub
parent dc83f1ad38
commit 7bc0dd1bf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -88,7 +88,7 @@ where
let received_at = Instant::now();
match bytes? {
WebSocketMessage::Binary(bytes) => {
zstd::stream::copy_decode(bytes.as_slice(), &mut self.encoding_buffer).unwrap();
zstd::stream::copy_decode(bytes.as_slice(), &mut self.encoding_buffer)?;
let envelope = Envelope::decode(self.encoding_buffer.as_slice())
.map_err(io::Error::from)?;