summaryrefslogtreecommitdiff
path: root/rust/examples
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2023-09-20 14:40:22 -0400
committerKyleMiles <krm504@nyu.edu>2023-09-20 15:06:35 -0400
commit052a8d2adb0c7899ae875c03da4edf80b2fa1a81 (patch)
tree51fef92c717c7cc3af22446e97aed1bb1fd0bedb /rust/examples
parentaf2e0455c082239b21bceffbaa1684f795cb1452 (diff)
Rust API : FFI Fix, was leaking some non-null-terminated strings to the core..fix passing a nullptr to `load`
Diffstat (limited to 'rust/examples')
-rw-r--r--rust/examples/dwarf/shared/src/lib.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/rust/examples/dwarf/shared/src/lib.rs b/rust/examples/dwarf/shared/src/lib.rs
index 0bf11771..29ca02a4 100644
--- a/rust/examples/dwarf/shared/src/lib.rs
+++ b/rust/examples/dwarf/shared/src/lib.rs
@@ -95,7 +95,6 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>(
let data = view.read_vec(data_var.address, data_type.width() as usize);
let element_type = data_type.element_type().unwrap().contents;
- // TODO : broke af?
if let Some(current_section_header) = data
.chunks(element_type.width() as usize)
.find(|section_header| {
@@ -104,11 +103,10 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>(
{
if (endian.read_u64(&current_section_header[8..16]) & 2048) != 0 {
// Get section, trim header, decompress, return
- let offset = section.start() + 24; // TODO : Super broke AF
+ let offset = section.start() + 24;
let len = section.len() - 24;
if let Ok(buffer) = view.read_buffer(offset, len) {
- // Incredibly broke as fuck
use std::ptr;
let transform_name =
CString::new("Zlib").unwrap().into_bytes_with_nul();