diff --git a/libclamav_rust/src/ctx.rs b/libclamav_rust/src/ctx.rs index e037eb24cc..fbef5c9d53 100644 --- a/libclamav_rust/src/ctx.rs +++ b/libclamav_rust/src/ctx.rs @@ -39,8 +39,8 @@ pub enum Error { #[error("No more files to extract")] NoMoreFiles, - #[error("Invalid FMap")] - BadMap, + #[error("Invalid FMap: {0}")] + BadMap(#[from] crate::fmap::Error), #[error("String not UTF8: {0}")] Utf8(#[from] std::str::Utf8Error), @@ -94,5 +94,5 @@ pub unsafe fn current_fmap(ctx: *mut cli_ctx) -> Result { let current_level = recursion_stack[recursion_level]; - current_level.fmap.try_into().map_err(|_| Error::BadMap) + current_level.fmap.try_into().map_err(Error::BadMap) } diff --git a/libclamav_rust/src/fmap.rs b/libclamav_rust/src/fmap.rs index f15d0ff961..6468da5adc 100644 --- a/libclamav_rust/src/fmap.rs +++ b/libclamav_rust/src/fmap.rs @@ -84,13 +84,6 @@ impl<'a> FMap { let slice: &[u8] = unsafe { std::slice::from_raw_parts(ptr, len) }; - debug!( - "need_off at {:?} len {:?} returned {:?}-byte slice", - at, - len, - slice.len() - ); - Ok(slice) }