aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/linux/minidump_writer/linux_ptrace_dumper.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
index 5ab59c27..95f12942 100644
--- a/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ b/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
@@ -282,8 +282,10 @@ bool LinuxPtraceDumper::ThreadsSuspend() {
// If the thread either disappeared before we could attach to it, or if
// it was part of the seccomp sandbox's trusted code, it is OK to
// silently drop it from the minidump.
- my_memmove(&threads_[i], &threads_[i+1],
- (threads_.size() - i - 1) * sizeof(threads_[i]));
+ if (i < threads_.size() - 1) {
+ my_memmove(&threads_[i], &threads_[i + 1],
+ (threads_.size() - i - 1) * sizeof(threads_[i]));
+ }
threads_.resize(threads_.size() - 1);
--i;
}