libtraceevent: Add eof checks

Added checking for __read_char() and peek_char() to make sure value is not
at end of file.

This issue was found while fuzz testing. One of the test cases created an
infinite loop because __read_token had reached end of file. Checking was
added to all cases where this may occur.

Link: https://lore.kernel.org/linux-trace-devel/20210617194326.2107129-1-cjense@google.com

Signed-off-by: Claire Jensen <cjense@google.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 file changed