fold: fix processing of malformed UTF-8 sequences

Resolves: RHEL-140117
This commit is contained in:
Lukáš Zaoral 2026-01-26 13:49:52 +01:00
parent fb9815244c
commit d7f14c41af
No known key found for this signature in database
GPG Key ID: 39157506DD67752D
2 changed files with 6 additions and 2 deletions

View File

@ -203,7 +203,7 @@ index 8cd0d6b..d23edd5 100644
/* Look for the last blank. */
while (logical_end)
{
@@ -215,11 +252,221 @@ fold_file (char const *filename, size_t width)
@@ -215,11 +252,222 @@ fold_file (char const *filename, size_t width)
line_out[offset_out++] = c;
}
@ -282,6 +282,7 @@ index 8cd0d6b..d23edd5 100644
+
+ /* Get a wide character. */
+ state_bak = state;
+ convfail = 0;
+ mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
+
+ switch (mblength)

View File

@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.30
Release: 16%{?dist}
Release: 17%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: https://www.gnu.org/software/coreutils/
@ -296,6 +296,9 @@ fi
%license COPYING
%changelog
* Mon Jan 26 2026 Lukáš Zaoral <lzaoral@redhat.com> - 8.30-17
- fold: fix processing of malformed UTF-8 sequences (RHEL-140117)
* Wed Oct 29 2025 Lukáš Zaoral <lzaoral@redhat.com> - 8.30-16
- fix du being killed by SIGABRT on mutating xfs systems (RHEL-124174)