We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a8896cf commit 11153bbCopy full SHA for 11153bb
1 file changed
simplicity-sys/src/alloc.rs
@@ -87,7 +87,7 @@ pub unsafe extern "C" fn rust_0_7_malloc(size_bytes: usize) -> *mut u8 {
87
/// Allocated bytes must be freed using [`rust_0_7_free`].
88
#[no_mangle]
89
pub unsafe extern "C" fn rust_0_7_calloc(num: usize, size: usize) -> *mut u8 {
90
- let size_bytes = num * size;
+ let size_bytes = num.saturating_mul(size);
91
// SAFETY: Allocator is `alloc_alloc_zeroed`.
92
allocate(size_bytes, alloc::alloc_zeroed)
93
}
0 commit comments