panic upon committing a zero-sized grant
Disasm opened this issue · comments
Sometimes zero-sized grant points beyond the buffer size (grant_ptr=buffer_ptr+buffer_len), with such grant commit
panics on assert!(self.is_our_grant(&grant.buf));
.
Repro:
use bbqueue::*;
fn main() {
let bbq = bbq!(1000).unwrap();
let size = 1000;
let grant = bbq.grant(size).unwrap();
bbq.commit(size, grant);
let grant = bbq.grant(0).unwrap();
bbq.commit(0, grant);
}
I'd be open for a PR that fixes the check in is_our_grant
!