diff --git a/src/libsysprof-capture/sysprof-capture-reader.c b/src/libsysprof-capture/sysprof-capture-reader.c index 29b94ca5..0759b332 100644 --- a/src/libsysprof-capture/sysprof-capture-reader.c +++ b/src/libsysprof-capture/sysprof-capture-reader.c @@ -491,6 +491,9 @@ sysprof_capture_reader_read_basic (SysprofCaptureReader *self, if (frame->type != type) return NULL; + if (frame->len > (self->len - self->pos)) + return NULL; + self->pos += frame->len; return frame;