libtraceevent: Do not read non printable characters
PATCH 1/1 libtraceevent: Do not read non printable characters
From: Cliff Wickman <[email protected]>
libtraceevent is getting into a loop if the trace.dat file contains corrupted strings ending in non-printable characters instead of quotes.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215121
Signed-off-by Cliff Wickman <[email protected]>
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- src/event-parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/event-parse.c +2 -1
@@ -1246,7 +1246,8 @@ static enum tep_event_type __read_token(char **tok)/* the '\' '\' will cancel itself */ if (ch =='\\' && last_ch =='\\' ) last_ch =0 ; - }while (ch != quote_ch || last_ch =='\\' ); +/* Break out if the file is corrupted and giving non print chars */ + }while ((ch != quote_ch &&isprint (ch)) || last_ch =='\\' );/* remove the last quote */ i--;
Signature · 1 line
2.31.1