From 7d34d88e5f327fc6c875fc7f1ec2b6d12417b9f2 Mon Sep 17 00:00:00 2001 From: Jan Bujak Date: Tue, 16 Nov 2021 09:06:30 +0000 Subject: [PATCH] Fix broken `reallocarray` implementation --- preload/src/api.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/preload/src/api.rs b/preload/src/api.rs index 97bd4e3..4dee07e 100644 --- a/preload/src/api.rs +++ b/preload/src/api.rs @@ -326,7 +326,7 @@ pub unsafe extern "C" fn realloc( old_ptr: *mut c_void, size: size_t ) -> *mut c } #[cfg_attr(not(test), no_mangle)] -pub unsafe extern "C" fn reallocarray( old_ptr: &mut c_void, count: size_t, element_size: size_t ) -> *mut c_void { +pub unsafe extern "C" fn reallocarray( old_ptr: *mut c_void, count: size_t, element_size: size_t ) -> *mut c_void { let size = match (count as usize).checked_mul( element_size as usize ) { None => { *libc::__errno_location() = libc::ENOMEM;