mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-06 18:33:44 +00:00
Check for len + 1 instead of len when seeing if we have enough bytes in the stream
This commit is contained in:
@@ -43,7 +43,7 @@ impl Message {
|
||||
// FIXME: What happens if len(u32) < len(usize) ?
|
||||
let len = BigEndian::read_u32(&src[1..5]) as usize;
|
||||
|
||||
if src.len() < len {
|
||||
if src.len() < (len + 1) {
|
||||
// We don't have enough in the stream yet
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user