From: Rob Clark Date: Tue, 4 Apr 2017 12:53:57 +0000 (-0400) Subject: gallium/util: fix missing limit check in libunwind backtrace X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c69ea553bfa8e23feedc5d3f479a9003c139bad;p=mesa.git gallium/util: fix missing limit check in libunwind backtrace Fixes: 70c272004f ("gallium/util: libunwind support") Signed-off-by: Rob Clark --- 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;