mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: check alignment in read length
We require aligned frames, so we might as well enforce it in the reader.
This commit is contained in:
@ -356,6 +356,9 @@ sysprof_capture_reader_ensure_space_for (SysprofCaptureReader *self,
|
||||
g_assert (self->pos <= self->len);
|
||||
g_assert (len > 0);
|
||||
|
||||
/* Ensure alignment of length to read */
|
||||
len = (len + SYSPROF_CAPTURE_ALIGN - 1) & ~(SYSPROF_CAPTURE_ALIGN - 1);
|
||||
|
||||
if ((self->len - self->pos) < len)
|
||||
{
|
||||
gssize r;
|
||||
|
||||
Reference in New Issue
Block a user