[catnip] Catnip's `MemoryPool::alloc_mbuf` Function Makes Incorrect Allocation Size Comparison
Description
Currently in catnip's MemoryPool::alloc_mbuf function there is a check to see "if allocated buffer is big enough" that compares the desired size (a usize taken as u16) against the actually allocated buffer size. This check will yield bogus results for cases where the desired size is greater than u16::MAX but less than u16::MAX + the actually allocated buffer size.
The correct check would promote the actually allocated buffer size from a u16 to a usize and perform the check against the two usizes.
@BrianZill could you add to the description of this issue the permalink for the concerned code?
Thanks!
I've added permalinks.
This is a low priority bug, as we should never attempt to call alloc_mbuf with such a size.