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>
Mon, 3 Jun 2024 15:03:37 +0000 (17:03 +0200)
commitca24b0613bae3b2cf9f8b23a4f96dec78ef44342
tree76142038e6aa2d0549fe237aa47f1bd1824cc9d6
parent725742068bfacd4a381f7f0a5d544f461ef5a2e3
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