From f147ac27f89f2eb0bed4120b38e31a4169f98efd Mon Sep 17 00:00:00 2001 From: Amrit kumar Mahto Date: Tue, 27 Jan 2026 21:03:19 +0530 Subject: [PATCH] re running for CI to pass checks --- src/rust/src/libccxr_exports/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rust/src/libccxr_exports/mod.rs b/src/rust/src/libccxr_exports/mod.rs index 009a441a1..f5016a95b 100644 --- a/src/rust/src/libccxr_exports/mod.rs +++ b/src/rust/src/libccxr_exports/mod.rs @@ -77,6 +77,10 @@ pub unsafe extern "C" fn ccxr_update_logger_target() { /// or less than `len`. #[no_mangle] pub unsafe extern "C" fn ccxr_verify_crc32(buf: *const u8, len: c_int) -> c_int { + // Safety: avoid NULL pointer and negative length causing usize wraparound + if buf.is_null() || len < 0 { + return 0; + } let buf = std::slice::from_raw_parts(buf, len as usize); if verify_crc32(buf) { 1