Pull in hardened BPF virtual machine (#9931)

This commit is contained in:
Jack May
2020-05-08 12:37:04 -07:00
parent 01c490d354
commit 92562b4349
8 changed files with 451 additions and 808 deletions

View File

@@ -25,7 +25,7 @@ impl BPFAllocator {
impl Alloc for BPFAllocator {
fn alloc(&mut self, layout: Layout) -> Result<u64, AllocErr> {
if self.pos + layout.size() as u64 <= self.len {
if self.pos.saturating_add(layout.size() as u64) <= self.len {
let addr = self.start + self.pos;
self.pos += layout.size() as u64;
Ok(addr)