Skip to content

Commit 790cb79

Browse files
committed
fix(UhyveIfVersion): assume big endian encoding
hermit-entry was modified against a local version of uhyve-interface that did not have the big endian change, but this change was not sent upstream to Uhyve as well. `from_ne_bytes`, which would use the host's endianness (following the same logic of the rest of the big endian support) is therefore wrong. Unfortunately, this was not caught before Hermit's 0.12.0 release. This change uses big endian for the Uhyve interface version number, in line with the preexisting code in uhyve-interface.
1 parent 18b2d71 commit 790cb79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/elf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl TryFrom<Note<'_>> for UhyveIfVersion {
173173
}
174174

175175
let data = <[u8; 4]>::try_from(value.desc).map_err(|_| ParseUhyveIfVersionError)?;
176-
let data = u32::from_ne_bytes(data);
176+
let data = u32::from_be_bytes(data);
177177

178178
Ok(Self(data))
179179
}

0 commit comments

Comments
 (0)