]> git.ipfire.org Git - thirdparty/util-linux.git/commit
rev: Check for wchar conversion errors
authorTim Hallmann <tim@t8w.de>
Sun, 24 Mar 2024 19:14:30 +0000 (20:14 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 26 Mar 2024 12:12:37 +0000 (13:12 +0100)
commita36ad2d8dbf75760948fe149f0ce3987872f5c57
tree497a85b948c2383e3a25f32adb9c3717769f693a
parent70f403b2218531cb2c77f6c33011bd2559e730d6
rev: Check for wchar conversion errors

Commit c9cc84621ca98ef85499e83ca56f05f12055f193 introduced a regression
where only the actual EOF is handled, not other error conditions
returning WEOF. This leads to an infinite loop upon encountering
conversion errors. For example (using LC_CTYPE="en_US.UTF-8"):

$ printf '\x80' | rev

Signed-off-by: Tim Hallmann <tim@t8w.de>
(cherry picked from commit a610cf8231a02163a4a2b2faf3047d24798fe180)
text-utils/rev.c