Skip to content

Commit ea2e514

Browse files
fix LEN_OF_ETC_MYTHRIL
1 parent 91f8747 commit ea2e514

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mythril/src/acpi/rsdt.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,12 @@ impl<'a, T: Array<Item = u8>> RSDTBuilder<'a, T> {
375375
})?;
376376

377377
for (i, (name, (sdt, size))) in self.map.iter().enumerate() {
378-
const LEN_OF_ETC_MYTHRIL: usize = 12;
378+
const ETC_MYTHRIL: &'static str = "etc/mythril/";
379379
const LEN_OF_NAME: usize = 4;
380-
let mut table_name_bytes = [0u8; LEN_OF_ETC_MYTHRIL + LEN_OF_NAME];
381-
table_name_bytes[0..LEN_OF_ETC_MYTHRIL]
382-
.copy_from_slice("etc/mythril/".as_bytes());
383-
table_name_bytes[LEN_OF_ETC_MYTHRIL..].copy_from_slice(name);
380+
let mut table_name_bytes = [0u8; ETC_MYTHRIL.len() + LEN_OF_NAME];
381+
table_name_bytes[0..ETC_MYTHRIL.len()]
382+
.copy_from_slice(ETC_MYTHRIL.as_bytes());
383+
table_name_bytes[ETC_MYTHRIL.len()..].copy_from_slice(name);
384384
let table_name = str::from_utf8(&table_name_bytes)?;
385385

386386
table_loader.add_command(TableLoaderCommand::Allocate {

0 commit comments

Comments
 (0)