trace-cmd: Fix possible usage of not null-terminated string

According to the
   readlink(const char *filename, char *buffer, size_t size);
documentation, the terminating '\0' is not written in the buffer.
As the buffer that is passed to this API is not initialized, this
can lead to working with not null-terminated string.
The problem was detected by valgrind.

Link: http://lore.kernel.org/linux-trace-devel/20200409132756.79402-2-tz.stoyanov@gmail.com

Fixes: 9e48d8df7 ("trace-cmd: Add initial infrastructure for trace-cmd specific plugins.")
Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2 files changed