From d671edd97638987173e750035214bd8e4906c5d0 Mon Sep 17 00:00:00 2001 From: quantumg Date: Wed, 26 Mar 2008 02:51:15 +0000 Subject: [PATCH] another oops. --- src/peekfd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/peekfd.c b/src/peekfd.c index 5d29681..35efb7f 100644 --- a/src/peekfd.c +++ b/src/peekfd.c @@ -70,7 +70,9 @@ void detach(void) { } void attach(pid_t pid) { - attached_pids[0] = pid; + if (num_attached_pids >= MAX_ATTACHED_PIDS) + return; + attached_pids[num_attached_pids] = pid; if (ptrace(PTRACE_ATTACH, pid, 0, 0) == -1) { fprintf(stderr, _("Error attaching to pid %i\n"), pid); return; -- 2.40.0