diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index ccf58610..b0902b1b 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -1136,6 +1136,10 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, procargs->data[procargs->number++] = arg; + len -= alen; + if (len <= 0) { + break; + } ptr += alen; }