Skip to content

Commit

Permalink
Improve LZH file type magic sigs, and C-Rust FFI memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
micahsnyder committed Mar 15, 2024
1 parent dbe2a72 commit 589994b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions libclamav/filetypes_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ static const char *ftypes_int[] = {
"0:0:00010d0a:PyPy 3.8 byte-compiled (.pyc):CL_TYPE_ANY:CL_TYPE_PYTHON_COMPILED:200",
"0:0:50010d0a:PyPy 3.9 byte-compiled (.pyc):CL_TYPE_ANY:CL_TYPE_PYTHON_COMPILED:200",
"1:0:??0d0d0a:Python 3.7 or newer byte-compiled (.pyc):CL_TYPE_ANY:CL_TYPE_PYTHON_COMPILED:200",
"1:0:????2d6c68(30|31|32|33|34|35|36|37|64|78)2d:LHA or LZH archive:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:0:????2d6c7a(73|34|35)2d:LHA archive using .LZS extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:0:????2d706d302d:LHA archive using PMarc (.PMA) extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:2:2d6c68(30|31|32|33|34|35|36|37|64|78)2d:LHA or LZH archive:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:2:2d6c7a(73|34|35)2d:LHA archive using .LZS extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
"1:2:2d706d302d:LHA archive using PMarc (.PMA) extension:CL_TYPE_ANY:CL_TYPE_LHA_LZH:210",
NULL};
#endif
4 changes: 2 additions & 2 deletions libclamav_rust/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub unsafe fn check_scan_limits(
}
};

unsafe { sys::cli_checklimits(module_name.into_raw(), ctx, need1, need2, need3) }
unsafe { sys::cli_checklimits(module_name.as_ptr(), ctx, need1, need2, need3) }
}

/// Scan archive metadata.
Expand Down Expand Up @@ -119,7 +119,7 @@ pub unsafe fn scan_archive_metadata(
unsafe {
sys::cli_matchmeta(
ctx,
module_name.into_raw(),
module_name.as_ptr(),
filesize_compressed,
filesize_original,
i32::from(is_encrypted),
Expand Down

0 comments on commit 589994b

Please sign in to comment.