summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-01-30 05:19:45 +0000
committerUlrich Drepper <drepper@redhat.com>2004-01-30 05:19:45 +0000
commit4bb333cdd2473418d798593c3dd448aa9b8b28e0 (patch)
tree3e194ae0ec0dc5db254e58037f0013ce9dd774f8 /posix
parent0c02c85fd350a5ee00945630182947506a330408 (diff)
downloadglibc-4bb333cdd2473418d798593c3dd448aa9b8b28e0.tar.gz
glibc-4bb333cdd2473418d798593c3dd448aa9b8b28e0.tar.xz
glibc-4bb333cdd2473418d798593c3dd448aa9b8b28e0.zip
(build_range_exp) [!_LIBC]: Check validity of collation elements.
Diffstat (limited to 'posix')
-rw-r--r--posix/regcomp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 4f53944709..33ca7c91e1 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2560,6 +2560,8 @@ build_range_exp (sbcset, start_elem, end_elem)
 		? __btowc (start_ch) : start_elem->opr.wch);
     end_wc = ((end_elem->type == SB_CHAR || end_elem->type == COLL_SYM)
 	      ? __btowc (end_ch) : end_elem->opr.wch);
+    if (start_wc == WEOF || end_wc == WEOF)
+      return REG_ECOLLATE;
     cmp_buf[0] = start_wc;
     cmp_buf[4] = end_wc;
     if (wcscoll (cmp_buf, cmp_buf + 4) > 0)