From b2830cafbc610faf1b958e9a7307f12640ab4157 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 12 Sep 2005 23:52:02 +0000 Subject: [PATCH] fix crash in proc_args if psinfo_t.pr_argc == 0 --- src/os/solaris/solaris_sigar.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 7cb2ee0d..fd235745 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -704,6 +704,11 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, } pinfo = sigar->pinfo; + if (pinfo->pr_argc == 0) { + procargs->number = procargs->size = 0; + return SIGAR_OK; + } + argv_size = sizeof(*argvp) * pinfo->pr_argc; (void)SIGAR_PROC_FILENAME(buffer, pid, "/as");