chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Never call qsort on potentially NULL arrays
[elogind.git]
/
src
/
shared
/
cgroup-show.c
diff --git
a/src/shared/cgroup-show.c
b/src/shared/cgroup-show.c
index e971f36190e216300e9641dec89bc95744265473..cc44ab4ea9ca1700135360cede64eb756f925ce9 100644
(file)
--- 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++) {