From 7c69ea553bfa8e23feedc5d3f479a9003c139bad Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 4 Apr 2017 08:53:57 -0400 Subject: [PATCH] gallium/util: fix missing limit check in libunwind backtrace Fixes: 70c272004f ("gallium/util: libunwind support") Signed-off-by: Rob Clark --- src/gallium/auxiliary/util/u_debug_stack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_debug_stack.c b/src/gallium/auxiliary/util/u_debug_stack.c index cf05f13ddd0..14d5b16c376 100644 --- a/src/gallium/auxiliary/util/u_debug_stack.c +++ b/src/gallium/auxiliary/util/u_debug_stack.c @@ -62,7 +62,7 @@ debug_backtrace_capture(struct debug_stack_frame *backtrace, while ((start_frame > 0) && (unw_step(&cursor) > 0)) start_frame--; - while (unw_step(&cursor) > 0) { + while ((i < nr_frames) && (unw_step(&cursor) > 0)) { char procname[256]; const char *filename; unw_word_t off; -- 2.30.2