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, 23 Jun 2024 23:31:42 +0000 (01:31 +0200)
commitecfc761acceb39849a128a6a5723b39ad2e25fc2
treed3ddc0d96b6d78f0c3bc2154f163792657105e77
parent06477af55fa2efe0c43624ef4494439f29944aef
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