Skip to content

Commit

Permalink
fix LEN_OF_ETC_MYTHRIL
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-starlab committed Feb 26, 2021
1 parent e9015eb commit e62f38e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mythril/src/acpi/rsdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,12 @@ impl<'a, T: Array<Item = u8>> RSDTBuilder<'a, T> {
})?;

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

table_loader.add_command(TableLoaderCommand::Allocate {
Expand Down

0 comments on commit e62f38e

Please sign in to comment.