Skip to content

Commit

Permalink
make sure path lives long enough
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 committed Jan 8, 2024
1 parent 0e9cabb commit fac231a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frida-gum/src/range_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum PageProtection {
/// The file association to a page.
#[derive(Clone)]
pub struct FileMapping<'a> {
path: &'a str,
path: String,

Check failure on line 45 in frida-gum/src/range_details.rs

View workflow job for this annotation

GitHub Actions / Check no_std

cannot find type `String` in this scope
size: usize,
offset: u64,
phantom: PhantomData<&'a gum_sys::GumFileMapping>,
Expand All @@ -55,7 +55,7 @@ impl<'a> FileMapping<'a> {
} else {
Some(unsafe {
Self {
path: CStr::from_ptr((*file).path).to_str().unwrap(),
path: CStr::from_ptr((*file).path).to_string_lossy().to_owned().to_string(),

Check failure on line 58 in frida-gum/src/range_details.rs

View workflow job for this annotation

GitHub Actions / Check no_std

no method named `to_owned` found for enum `Cow<'_, str>` in the current scope
size: (*file).size as usize,
offset: (*file).offset,
phantom: PhantomData,
Expand All @@ -66,7 +66,7 @@ impl<'a> FileMapping<'a> {

/// The path of the file mapping on disk.
pub fn path(&self) -> &str {
self.path
&self.path
}

/// The offset into the file mapping.
Expand Down

0 comments on commit fac231a

Please sign in to comment.