From: Michael Niedermayer <[email protected]> This may be security relevant depending upon the used terminal.
Signed-off-by: Michael Niedermayer <[email protected]> Signed-off-by: Anton Khirnov <[email protected]> --- libavutil/log.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/libavutil/log.c b/libavutil/log.c index c44130c..fe9a54e 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -80,6 +80,14 @@ const char* av_default_item_name(void* ptr){ return (*(AVClass**)ptr)->class_name; } +static void sanitize(uint8_t *line){ + while(*line){ + if(*line < 0x08 || (*line > 0x0D && *line < 0x20)) + *line='?'; + line++; + } +} + void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) { static int print_prefix=1; @@ -120,6 +128,7 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) fprintf(stderr, " Last message repeated %d times\n", count); count=0; } + sanitize(line); colored_fputs(av_clip(level>>3, 0, 6), line); av_strlcpy(prev, line, sizeof line); } -- 1.7.5.1 _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
