libsmartcols: fix reduction stages use
authorKarel Zak <kzak@redhat.com>
Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)
committerChris Hofstaedtler <zeha@debian.org>
Thu, 30 May 2024 17:14:16 +0000 (19:14 +0200)
commit2e429d63386546e7d3dd88795f3645db3859ab2c
tree0158155a142aaadb6b89a095fb0fb9182500e2f3
parentf10daf5cf3da2c8335128b91c491442132602ba6
libsmartcols: fix reduction stages use

There is no proper check for the number of reduction stages, so in
some cases, the code can loop indefinitely.

The patch also fixes 'rc' variable shadowing.

Fixes: https://github.com/util-linux/util-linux/issues/3046
Signed-off-by: Karel Zak <kzak@redhat.com>
Gbp-Pq: Topic upstream-master
Gbp-Pq: Name libsmartcols-fix-reduction-stages-use.patch
libsmartcols/src/calculate.c