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>
Sun, 26 May 2024 13:52:22 +0000 (15:52 +0200)
commitdb7169e1ed5b6be95855fbfd7c29ad08dda432d5
treee6fb6926deb46cdc09759be031a562875f0998d9
parent2e120f34249db120059eeda7fd96a69c51694334
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