about summary refs log tree commit diff
path: root/posix/fnmatch_loop.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2020-09-16 12:41:14 +0200
committerAndreas Schwab <schwab@suse.de>2020-09-16 14:45:10 +0200
commita140ff9162f353e804d6a8c83c8f3c18511850dd (patch)
treea2e8b02861633aa706fc07588926b75f9835dcd2 /posix/fnmatch_loop.c
parent4b564f347fdcd021dbb6c1ada98a18249d9e888a (diff)
downloadglibc-a140ff9162f353e804d6a8c83c8f3c18511850dd.tar.gz
glibc-a140ff9162f353e804d6a8c83c8f3c18511850dd.tar.xz
glibc-a140ff9162f353e804d6a8c83c8f3c18511850dd.zip
Fix handling of collating symbols in fnmatch (bug 26620)
The variable idx contains the index into the extra array, whereas wextra
points into the extra array at this index, containing the length of the
following collating sequence in the wide character representation.
Diffstat (limited to 'posix/fnmatch_loop.c')
-rw-r--r--posix/fnmatch_loop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
index 8ead4dc7b9..0f890d4782 100644
--- a/posix/fnmatch_loop.c
+++ b/posix/fnmatch_loop.c
@@ -564,7 +564,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 				/* Get the collation sequence value.  */
 				is_seqval = 1;
 # if WIDE_CHAR_VERSION
-				cold = wextra[1 + wextra[idx]];
+				cold = wextra[1 + wextra[0]];
 # else
 				idx += 1 + extra[idx];
 				/* Adjust for the alignment.  */
@@ -738,7 +738,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
 				    /* Get the collation sequence value.  */
 				    is_seqval = 1;
 # if WIDE_CHAR_VERSION
-				    cend = wextra[1 + wextra[idx]];
+				    cend = wextra[1 + wextra[0]];
 # else
 				    idx += 1 + extra[idx];
 				    /* Adjust for the alignment.  */