fix crash in proc_args if psinfo_t.pr_argc == 0
This commit is contained in:
parent
9ec93a73ed
commit
b2830cafbc
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue