]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/powerpc/powerpc64/backtrace.c
Fix array overflow in backtrace on PowerPC (bug 25423)
[thirdparty/glibc.git] / sysdeps / powerpc / powerpc64 / backtrace.c
index c0c4b48262cf30d2f30c0dc11b85bc550fcff6ea..0acf17b37e45e32476ee3be60cc49480455d02d4 100644 (file)
@@ -87,6 +87,8 @@ __backtrace (void **array, int size)
       if (is_sigtramp_address (current->return_address))
         {
          struct signal_frame_64 *sigframe = (struct signal_frame_64*) current;
+         if (count + 1 == size)
+           break;
           array[++count] = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_NIP];
          current = (void*) sigframe->uc.uc_mcontext.gp_regs[PT_R1];
        }