Unlikely to ever happen, but just in case.
Signed-off-by: Craig Small <csmall@enc.com.au>
#include <sys/types.h>
#include <unistd.h>
#include <assert.h>
+#include <limits.h>
#include "c.h"
#include "fileutils.h"
}
}
}
+ if ((size_t)argc >= INT_MAX / sizeof(pid_t))
+ xerrx(EXIT_FAILURE, _("too many arguments"));
if (procps_pids_new(&Pids_info, Pid_items, 4))
xerrx(EXIT_FAILURE, _("library failed pids statistics"));
pidlist = xmalloc(sizeof(pid_t) * argc);