This was broken in commit 17ab86c52 as the forced rounding up of the size to 4-byte alignment in BigBuf_malloc made the size check possibly larger than the buffer size as the check was always +3 on the requested size rather than the rounded size. This was made worse by BigBuf_max_traceLen not taking into account alignment either and the alignmentn check in hfsnoop.c checking to 2 byte alignment instead of 4 byte alignment.
The alignment size check now checks the size after alignment rounding, and BigBuf_max_traceLen takes into account alignment losses too reducing the need for BigBuf consumers to have to care about alignment.
This was broken in commit 17ab86c52 as the forced rounding up of the size to 4-byte alignment in BigBuf_malloc made the size check possibly larger than the buffer size as the check was always +3 on the requested size rather than the rounded size. This was made worse by BigBuf_max_traceLen not taking into account alignment either and the alignmentn check in hfsnoop.c checking to 2 byte alignment instead of 4 byte alignment.
The alignment size check now checks the size after alignment rounding, and BigBuf_max_traceLen takes into account alignment losses too reducing the need for BigBuf consumers to have to care about alignment.