diff options
Diffstat (limited to 'sysdeps/i386')
-rw-r--r-- | sysdeps/i386/backtrace.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/i386/backtrace.c b/sysdeps/i386/backtrace.c index 550234f577..f10ed566dc 100644 --- a/sysdeps/i386/backtrace.c +++ b/sysdeps/i386/backtrace.c @@ -114,6 +114,10 @@ __backtrace (array, size) int size; { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; + + if (size <= 0) + return 0; + #ifdef SHARED __libc_once_define (static, once); @@ -122,8 +126,7 @@ __backtrace (array, size) return 0; #endif - if (size >= 1) - unwind_backtrace (backtrace_helper, &arg); + unwind_backtrace (backtrace_helper, &arg); if (arg.cnt > 1 && arg.array[arg.cnt - 1] == NULL) --arg.cnt; |