diff options
author | Karel Zak | 2016-01-18 10:47:22 +0100 |
---|---|---|
committer | Karel Zak | 2016-01-18 10:47:22 +0100 |
commit | 8afabdb1fa1388c022101d0a8ab932bcaa3c8e34 (patch) | |
tree | ea1908b05037d79c76ffd36af97c832fd0609a1b /libsmartcols/src/table.c | |
parent | libsmartcols: be sure column is unused (diff) | |
download | kernel-qcow2-util-linux-8afabdb1fa1388c022101d0a8ab932bcaa3c8e34.tar.gz kernel-qcow2-util-linux-8afabdb1fa1388c022101d0a8ab932bcaa3c8e34.tar.xz kernel-qcow2-util-linux-8afabdb1fa1388c022101d0a8ab932bcaa3c8e34.zip |
libsmartcols: don't sort if cmpfunc() is not set
Reported-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Diffstat (limited to 'libsmartcols/src/table.c')
-rw-r--r-- | libsmartcols/src/table.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsmartcols/src/table.c b/libsmartcols/src/table.c index ca1e64825..7885ba249 100644 --- a/libsmartcols/src/table.c +++ b/libsmartcols/src/table.c @@ -1075,7 +1075,7 @@ static int cells_cmp_wrapper(struct list_head *a, struct list_head *b, void *dat */ int scols_sort_table(struct libscols_table *tb, struct libscols_column *cl) { - if (!tb || !cl) + if (!tb || !cl || !cl->cmpfunc) return -EINVAL; DBG(TAB, ul_debugobj(tb, "sorting table")); |