mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-19 15:50:18 +00:00
fix(bls): convert less safe path concatenation to use path buffer
This commit is contained in:
@@ -6,7 +6,6 @@ use anyhow::{Context, Result};
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use uefi::CString16;
|
|
||||||
use uefi::fs::{FileSystem, Path};
|
use uefi::fs::{FileSystem, Path};
|
||||||
use uefi::proto::device_path::text::{AllowShortcuts, DisplayOnly};
|
use uefi::proto::device_path::text::{AllowShortcuts, DisplayOnly};
|
||||||
use uefi::proto::media::fs::SimpleFileSystem;
|
use uefi::proto::media::fs::SimpleFileSystem;
|
||||||
@@ -89,10 +88,9 @@ pub fn generate(context: Rc<SproutContext>, bls: &BlsConfiguration) -> Result<Ve
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Produce the full path to the entry file.
|
// Create a mutable path so we can append the file name to produce the full path.
|
||||||
let full_entry_path = CString16::try_from(format!("{}\\{}", sub_text_path, name).as_str())
|
let mut full_entry_path = entries_path.to_path_buf();
|
||||||
.context("unable to construct full entry path")?;
|
full_entry_path.push(entry.file_name());
|
||||||
let full_entry_path = Path::new(&full_entry_path);
|
|
||||||
|
|
||||||
// Read the entry file.
|
// Read the entry file.
|
||||||
let content = fs
|
let content = fs
|
||||||
|
|||||||
Reference in New Issue
Block a user