summaryrefslogtreecommitdiff
path: root/strmatch
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2009-05-29 07:47:52 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2009-05-29 07:47:52 +0000
commit97e793b8b73d474f695c4c9495bcf0fd231dddd5 (patch)
treed6ab243bf4894a55d4d479c69c892f80557a7759 /strmatch
parente1c39bcfb4dfcc31792291e8682395c5a619cbf1 (diff)
downloadapr-97e793b8b73d474f695c4c9495bcf0fd231dddd5.tar.gz
SECURITY: CVE-2009-0023
Fix underflow in apr_strmatch_precompile. Submitted by: Matthew Palmer <mpalmer debian.org> git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@779878 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'strmatch')
-rw-r--r--strmatch/apr_strmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strmatch/apr_strmatch.c b/strmatch/apr_strmatch.c
index 7fec638c8..75ed6153c 100644
--- a/strmatch/apr_strmatch.c
+++ b/strmatch/apr_strmatch.c
@@ -103,13 +103,13 @@ APU_DECLARE(const apr_strmatch_pattern *) apr_strmatch_precompile(
if (case_sensitive) {
pattern->compare = match_boyer_moore_horspool;
for (i = 0; i < pattern->length - 1; i++) {
- shift[(int)s[i]] = pattern->length - i - 1;
+ shift[(unsigned char)s[i]] = pattern->length - i - 1;
}
}
else {
pattern->compare = match_boyer_moore_horspool_nocase;
for (i = 0; i < pattern->length - 1; i++) {
- shift[apr_tolower(s[i])] = pattern->length - i - 1;
+ shift[(unsigned char)apr_tolower(s[i])] = pattern->length - i - 1;
}
}
pattern->context = shift;