]> granicus.if.org Git - psmisc/commitdiff
another oops.
authorquantumg <quantumg>
Wed, 26 Mar 2008 02:51:15 +0000 (02:51 +0000)
committerquantumg <quantumg>
Wed, 26 Mar 2008 02:51:15 +0000 (02:51 +0000)
src/peekfd.c

index 5d2968198d4835700a2f3185ae9aa02635b65c66..35efb7f2c03e786910598b7c34b429791053058f 100644 (file)
@@ -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;