Re: [PATCH] trace-cmd: prevent print_graph_duration buffer overflow

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chase Douglas
Date: Sunday, June 13, 2010 - 2:01 pm

On Sun, 2010-06-13 at 16:52 -0400, Valdis.Kletnieks@vt.edu wrote:

nsecs_str is a local variable defined just above this block of code as:

	char nsecs_str[5];

I was hitting cases where s->len == 64 and len == 63, leading to the
size argument of snprintf being 7 on a 5 byte string. I didn't delve too
much into the reasoning for the if statement, but I think it's math is
not actually related to the size of nsecs_rem but to some other string
length.

-- Chase

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] trace-cmd: prevent print_graph_duration buffer ..., Chase Douglas, (Sun Jun 13, 2:01 pm)
Re: [PATCH] trace-cmd: prevent print_graph_duration buffer ..., Frederic Weisbecker, (Tue Jun 15, 5:49 am)
Re: [PATCH] trace-cmd: prevent print_graph_duration buffer ..., Frederic Weisbecker, (Tue Jun 15, 6:10 am)