Skip to content

Commit

Permalink
fix: underflow in recv (#53)
Browse files Browse the repository at this point in the history
* fix: read length
  • Loading branch information
MahieDev authored Nov 10, 2024
1 parent 61ba07e commit ec0ae68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion adb_client/src/server/device_commands/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<R: Read> Read for ADBRecvCommandReader<R> {
match &header[..] {
b"DATA" => {
let length = self.inner.read_u32::<LittleEndian>()? as usize;
let effective_read = self.inner.read(buf)?;
let effective_read = self.inner.read(&mut buf[0..length])?;
self.remaining_data_bytes_to_read = length - effective_read;

Ok(effective_read)
Expand Down

0 comments on commit ec0ae68

Please sign in to comment.