From: quantumg Date: Wed, 26 Mar 2008 02:51:15 +0000 (+0000) Subject: another oops. X-Git-Tag: v22.11~38 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d671edd97638987173e750035214bd8e4906c5d0;p=psmisc another oops. --- 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;