]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libsmartcols: fix reduction stages use
authorKarel Zak <kzak@redhat.com>
Wed, 15 May 2024 13:45:19 +0000 (15:45 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 27 May 2024 13:09:27 +0000 (15:09 +0200)
commita74b911bd9f20670ead92973bcacab4ef8fa3b79
tree084b0e1c4d3d1b1052e0414c29532e31d3422886
parent9ba8eb5d89f0ebba8b3a542c041a5838e10a0d75
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>
(cherry picked from commit 8a01276a3c5bc09dce342e087019c704d8c56a32)
libsmartcols/src/calculate.c