Fix CI after CVE fixes (#5245)

* Fix CI after CVE fixes

Alas we can't run CI ahead of time so this fixes various minor build
issues from the merging of the recent CVE fixes. Note that I plan to
publish the advisories once CI issues are sorted out.

* Fix mmap/free of zero bytes
This commit is contained in:
Alex Crichton
2022-11-10 13:35:15 -06:00
committed by GitHub
parent f0fccbd18a
commit 92f6fe36cc
2 changed files with 8 additions and 2 deletions

View File

@@ -422,6 +422,7 @@ impl MemoryImageSlot {
}
}
#[cfg(feature = "pooling-allocator")]
pub(crate) fn dummy() -> MemoryImageSlot {
MemoryImageSlot {
base: 0,
@@ -760,6 +761,12 @@ impl MemoryImageSlot {
/// Map anonymous zeroed memory across the whole slot,
/// inaccessible. Used both during instantiate and during drop.
fn reset_with_anon_memory(&mut self) -> Result<()> {
if self.static_size == 0 {
assert!(self.image.is_none());
assert_eq!(self.accessible, 0);
return Ok(());
}
unsafe {
cfg_if::cfg_if! {
if #[cfg(unix)] {