[coreutils] change assertion failure for invalid multibyte input in sort to less confusing error message(#591352
Ondrej Vasik
ovasik at fedoraproject.org
Mon Sep 20 11:20:38 UTC 2010
commit a921d1b238a341c5196e2a726e106892fbc6402f
Author: Ondřej Vašík <ovasik at redhat.com>
Date: Mon Sep 20 13:19:42 2010 +0200
change assertion failure for invalid multibyte input in sort to less confusing error message(#591352)
coreutils-i18n.patch | 5 +++--
coreutils.spec | 6 +++++-
2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/coreutils-i18n.patch b/coreutils-i18n.patch
index d6e6c46..9bd30c6 100644
--- a/coreutils-i18n.patch
+++ b/coreutils-i18n.patch
@@ -2932,7 +2932,7 @@ diff -urNp coreutils-8.5-orig/src/sort.c coreutils-8.5/src/sort.c
{
size_t lo = 0;
size_t hi = MONTHS_PER_YEAR;
-@@ -2062,11 +2390,79 @@ compare_version (char *restrict texta, s
+@@ -2062,11 +2390,80 @@ compare_version (char *restrict texta, s
return diff;
}
@@ -2969,7 +2969,8 @@ diff -urNp coreutils-8.5-orig/src/sort.c coreutils-8.5/src/sort.c
+ memset (&state, '\0', sizeof(mbstate_t));
+
+ wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
-+ assert (wclength != (size_t)-1 && *pp == NULL);
++ if (wclength == (size_t)-1 || *pp != NULL)
++ error (SORT_FAILURE, 0, _("Invalid multibyte input %s."), quote(s));
+
+ for (i = 0; i < wclength; i++)
+ {
diff --git a/coreutils.spec b/coreutils.spec
index 3774910..79fc848 100644
--- a/coreutils.spec
+++ b/coreutils.spec
@@ -1,7 +1,7 @@
Summary: A set of basic GNU tools commonly used in shell scripts
Name: coreutils
Version: 8.5
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPLv3+
Group: System Environment/Base
Url: http://www.gnu.org/software/coreutils/
@@ -344,6 +344,10 @@ fi
%{_libdir}/coreutils
%changelog
+* Mon Sep 20 2010 Ondrej Vasik <ovasik at redhat.com> - 8.5-8
+- change assertion failure for invalid multibyte input
+ in sort to less confusing error message(#591352)
+
* Wed Sep 09 2010 Ondrej Vasik <ovasik at redhat.com> - 8.5-7
- add RELRO protection to su as well (#630017)
More information about the scm-commits
mailing list