summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2016-07-22 14:24:17 +0000
committerache <ache@FreeBSD.org>2016-07-22 14:24:17 +0000
commit3f56839b4888f5f2140b74ea536b9a0cee3a5084 (patch)
treede0154f18a175a32c0020a7fc90088448957417c /lib/libc/gen
parente3c997f56b8acb47dd382a8e4ced061d664ae7b2 (diff)
downloadFreeBSD-src-3f56839b4888f5f2140b74ea536b9a0cee3a5084.zip
FreeBSD-src-3f56839b4888f5f2140b74ea536b9a0cee3a5084.tar.gz
MFC: r302824
1) Eliminate possibility to call __*collate_range_cmp() with inclomplete locale (which cause core dump) by removing whole 'table' argument by which it passed. 2) Restore __collate_range_cmp() in __sccl(). 3) Collating [a-z] range in regcomp() works for single byte locales only (we can't do it for other ones). In previous state only first 256 wide chars are considered and all others are just silently dropped from the range.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/fnmatch.c4
-rw-r--r--lib/libc/gen/glob.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/fnmatch.c b/lib/libc/gen/fnmatch.c
index db0bf89..db15494 100644
--- a/lib/libc/gen/fnmatch.c
+++ b/lib/libc/gen/fnmatch.c
@@ -304,8 +304,8 @@ rangematch(pattern, test, flags, newp, patmbs)
if (table->__collate_load_error ?
c <= test && test <= c2 :
- __collate_range_cmp(table, c, test) <= 0
- && __collate_range_cmp(table, test, c2) <= 0
+ __wcollate_range_cmp(c, test) <= 0
+ && __wcollate_range_cmp(test, c2) <= 0
)
ok = 1;
} else if (c == test)
diff --git a/lib/libc/gen/glob.c b/lib/libc/gen/glob.c
index 95a3a06..6c86297 100644
--- a/lib/libc/gen/glob.c
+++ b/lib/libc/gen/glob.c
@@ -836,8 +836,8 @@ match(Char *name, Char *pat, Char *patend)
if ((*pat & M_MASK) == M_RNG) {
if (table->__collate_load_error ?
CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) :
- __collate_range_cmp(table, CHAR(c), CHAR(k)) <= 0
- && __collate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0
+ __wcollate_range_cmp(CHAR(c), CHAR(k)) <= 0
+ && __wcollate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0
)
ok = 1;
pat += 2;
OpenPOWER on IntegriCloud