about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-05-05 09:59:25 -0700
committerPetr Baudis <pasky@ucw.cz>2010-05-12 03:21:23 +0200
commitb9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa (patch)
treef014ed0181157ccb7224e059fb34c3c6352e36f7
parent50a66cf51789d82e515951a9d378bfacc0289df7 (diff)
downloadglibc-b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa.tar.gz
glibc-b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa.tar.xz
glibc-b9b562e8bc985e9dd7f1cc0ef8aeb32e448e9cfa.zip
Fix lookup of collation sequence value during regexp matching
(cherry picked from commit d84acf388ed8b3f162dda0512139095bfc268beb)
-rw-r--r--ChangeLog5
-rw-r--r--posix/regexec.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 373742c428..921df9b31a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-04  Andreas Schwab  <schwab@redhat.com>
+
+	* posix/regexec.c (find_collation_sequence_value): Fix skipping
+	the wide char sequence of the collating element.
+
 2010-05-03  Ulrich Drepper  <drepper@redhat.com>
 
 	[BZ #11149]
diff --git a/posix/regexec.c b/posix/regexec.c
index 7bf0c08a78..8481b618da 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -3998,7 +3998,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
 	  /* Skip the collation sequence value.  */
 	  idx += sizeof (uint32_t);
 	  /* Skip the wide char sequence of the collating element.  */
-	  idx = idx + sizeof (uint32_t) * (extra[idx] + 1);
+	  idx = idx + sizeof (uint32_t) * (*(int32_t *) (extra + idx) + 1);
 	  /* If we found the entry, return the sequence value.  */
 	  if (found)
 	    return *(uint32_t *) (extra + idx);