libsmartcols: fix reduction stages use
authorKarel Zak <kzak@redhat.com>
Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Wed, 5 Jun 2024 15:23:00 +0000 (17:23 +0200)
commite27664951ba79ac9a15406f0b9fcf2e93e7f036d
tree098b1fe81b8600520b7962fac1bc5505f55e9cd3
parent75a0eb61649ab4f24492d5c3faa3b2b65f44e6df
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