fix: clipboard cm ipc data, raw bytes (#8930)

* fix: clipboard cm ipc data, raw bytes

Signed-off-by: fufesou <linlong1266@gmail.com>

* Remove useless check

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-08-02 21:36:49 +08:00 committed by GitHub
parent 5e7d4fd2d6
commit 6eea425280
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,14 +150,8 @@ impl Handler {
Ok(Ok(mut data)) => {
for c in &mut contents {
if c.next_raw {
if c.content_len <= data.len() {
c.content =
data.split_off(c.content_len).into();
} else {
// Reconnect the next time to avoid the next raw data mismatch.
self.stream = None;
bail!("failed to get raw clipboard data: invalid size");
}
// No need to check the length because sum(content_len) == data.len().
c.content = data.split_to(c.content_len).into();
}
}
}