Messages in this thread Patch in this message | | | Date | Sat, 17 Oct 2009 18:08:29 +0200 | From | Tim Blechmann <> | Subject | [PATCH] perf tools: delay_secs safety |
| |
add delay_secs sanity check to handle_keypress, fixes a division by zero crash.
Signed-off-by: Tim Blechmann <tim@klingt.org> --- tools/perf/builtin-top.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 2d8806b..cc66286 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -663,6 +663,8 @@ static void handle_keypress(int c) switch (c) { case 'd': prompt_integer(&delay_secs, "Enter display delay"); + if (delay_secs < 1) + delay_secs = 1; break; case 'e': prompt_integer(&print_entries, "Enter display entries (lines)"); [unhandled content-type:application/pgp-signature]
| |