From 1486b87692d7a91d1588d59777d0efc8c2dd6e64 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 3 Jan 2006 20:22:12 +0000 Subject: [PATCH] add sanity check --- src/os/darwin/darwin_sigar.c | 4 ++++ 1 file changed, 4 insertions(+) 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; }