From 89cead8a526e3ef544a5aef93649c3c3ab9ec3ce Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Fri, 15 Mar 2024 16:35:34 -0400 Subject: [PATCH] Improve LZH file type magic sigs, and C-Rust FFI memory leak --- libclamav/filetypes_int.h | 6 +++--- libclamav_rust/src/util.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libclamav/filetypes_int.h b/libclamav/filetypes_int.h index 7231779586..832b6c3942 100644 --- a/libclamav/filetypes_int.h +++ b/libclamav/filetypes_int.h @@ -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 diff --git a/libclamav_rust/src/util.rs b/libclamav_rust/src/util.rs index cb60d5236c..086fdf2786 100644 --- a/libclamav_rust/src/util.rs +++ b/libclamav_rust/src/util.rs @@ -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. @@ -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),