diff options
| author | Rubens Brandao <git@rubens.io> | 2024-04-17 09:35:12 -0300 |
|---|---|---|
| committer | Rubens Brandao <git@rubens.io> | 2024-04-17 09:41:58 -0300 |
| commit | 9717866665a42356881b062fcd80bc09492ee8b8 (patch) | |
| tree | 3deda26aa66d55689eaf1333b67fceed0631b27a /rust/src/demangle.rs | |
| parent | f408eb32085956f7e29e0f15fd92aa4b72453370 (diff) | |
remove unecessary and crash causing zeroed call inits
Diffstat (limited to 'rust/src/demangle.rs')
| -rw-r--r-- | rust/src/demangle.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/src/demangle.rs b/rust/src/demangle.rs index 19eb085c..3756ea06 100644 --- a/rust/src/demangle.rs +++ b/rust/src/demangle.rs @@ -33,8 +33,8 @@ pub fn demangle_gnu3<S: BnStrCompatible>( ) -> Result<(Option<Ref<Type>>, Vec<String>)> { let mangled_name_bwn = mangled_name.into_bytes_with_nul(); let mangled_name_ptr = mangled_name_bwn.as_ref(); - let mut out_type: *mut BNType = unsafe { std::mem::zeroed() }; - let mut out_name: *mut *mut std::os::raw::c_char = unsafe { std::mem::zeroed() }; + let mut out_type: *mut BNType = std::ptr::null_mut(); + let mut out_name: *mut *mut std::os::raw::c_char = std::ptr::null_mut(); let mut out_size: usize = 0; let res = unsafe { BNDemangleGNU3( @@ -89,8 +89,8 @@ pub fn demangle_ms<S: BnStrCompatible>( let mangled_name_bwn = mangled_name.into_bytes_with_nul(); let mangled_name_ptr = mangled_name_bwn.as_ref(); - let mut out_type: *mut BNType = unsafe { std::mem::zeroed() }; - let mut out_name: *mut *mut std::os::raw::c_char = unsafe { std::mem::zeroed() }; + let mut out_type: *mut BNType = std::ptr::null_mut(); + let mut out_name: *mut *mut std::os::raw::c_char = std::ptr::null_mut(); let mut out_size: usize = 0; let res = unsafe { BNDemangleMS( |
