From 7ff7394d9e4e9189c30fd018235e6b1728c6f2d0 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Fri, 11 Oct 2013 19:33:13 -0400 Subject: Never call qsort on potentially NULL arrays This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero. --- src/shared/cgroup-show.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/shared/cgroup-show.c') diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c index e971f36190..cc44ab4ea9 100644 --- a/src/shared/cgroup-show.c +++ b/src/shared/cgroup-show.c @@ -44,6 +44,8 @@ static void show_pid_array(int pids[], unsigned n_pids, const char *prefix, unsi unsigned i, m, pid_width; pid_t biggest = 0; + assert(n_pids > 0); + /* Filter duplicates */ m = 0; for (i = 0; i < n_pids; i++) { -- cgit v1.2.3-54-g00ecf