mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
libsysprof-capture: ensure trailing bit is zero
This ensures situations that are not perfectly aligned can still be 1-off checked for a trailing \0 without scanning.
This commit is contained in:
@ -613,6 +613,8 @@ sysprof_capture_writer_add_map (SysprofCaptureWriter *self,
|
||||
_sysprof_strlcpy (ev->filename, filename, len - sizeof *ev);
|
||||
ev->filename[len - sizeof *ev - 1] = '\0';
|
||||
|
||||
((char*)ev)[len-1] = 0;
|
||||
|
||||
self->stat.frame_count[SYSPROF_CAPTURE_FRAME_MAP]++;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user