if (n<1)
goto out;
pid = strtoul(buf+1,&endp,10);
- if(endp<=buf+1 || pid<1 || pid>0x7fffffff)
+ if(endp<=buf+1 || pid<1 )
goto out;
if(*endp && !isspace(*endp))
goto out;
ns_flags = 0;
id = procps_ns_get_id(name);
- if (id == -1)
+ if (id < 0)
return 0;
ns_flags |= (1 << id);
if (opt_long || opt_longlong || (match && opt_pattern)) {
if (opt_longlong)
- strncpy (cmdoutput, task_cmdline, CMDSTRSIZE);
+ strncpy (cmdoutput, task_cmdline, CMDSTRSIZE-1);
else
- strncpy (cmdoutput, PIDS_GETSTR(CMD), CMDSTRSIZE);
+ strncpy (cmdoutput, PIDS_GETSTR(CMD), CMDSTRSIZE-1);
}
if (match && opt_pattern) {
if (opt_full)
- strncpy (cmdsearch, task_cmdline, CMDSTRSIZE);
+ strncpy (cmdsearch, task_cmdline, CMDSTRSIZE-1);
else
- strncpy (cmdsearch, PIDS_GETSTR(CMD), CMDSTRSIZE);
+ strncpy (cmdsearch, PIDS_GETSTR(CMD), CMDSTRSIZE-1);
if (regexec (preg, cmdsearch, 0, NULL, 0) != 0)
match = 0;