mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-08-22 06:12:04 +10:00
Fix archive backend crash (#475)
* Fix archive backend * Fix overflow bug + add workflow * Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix lint --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
parent
e654cdf52e
commit
c5a70e6801
@@ -1,4 +1,6 @@
|
||||
#![deny(clippy::all)]
|
||||
// `#[async_trait]` emits `#[must_use]` on futures that are already `#[must_use]`, tripping `double_must_use`.
|
||||
#![allow(clippy::double_must_use)]
|
||||
#![feature(impl_trait_in_bindings)]
|
||||
pub mod file_utils;
|
||||
pub mod manifest;
|
||||
|
||||
@@ -41,8 +41,8 @@ impl AsyncRead for ArchiveReader {
|
||||
) -> std::task::Poll<std::io::Result<()>> {
|
||||
if let Some(block) = &mut self.prev_block {
|
||||
let to_read = buf.remaining().min(block.len());
|
||||
let result = block.split_off(to_read);
|
||||
buf.put_slice(&result);
|
||||
buf.put_slice(&block[..to_read]);
|
||||
block.drain(..to_read);
|
||||
|
||||
// If the block is empty, we can read more
|
||||
if block.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user