apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r779878 - in /apr/apr/trunk: CHANGES strmatch/apr_strmatch.c
Date Fri, 29 May 2009 07:47:53 GMT
Author: wrowe
Date: Fri May 29 07:47:52 2009
New Revision: 779878

URL: http://svn.apache.org/viewvc?rev=779878&view=rev
Log:
Fix underflow in apr_strmatch_precompile.

Submitted by: Matthew Palmer <mpalmer debian.org>


Modified:
    apr/apr/trunk/CHANGES
    apr/apr/trunk/strmatch/apr_strmatch.c

Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=779878&r1=779877&r2=779878&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Fri May 29 07:47:52 2009
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 2.0.0
 
+  *) Fix underflow in apr_strmatch_precompile.
+     [Matthew Palmer <mpalmer debian.org>]
+
   *) Fix off by one overflow in apr_brigade_vprintf.
      [C. Michael Pilato <cmpilato collab.net>]
 

Modified: apr/apr/trunk/strmatch/apr_strmatch.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/strmatch/apr_strmatch.c?rev=779878&r1=779877&r2=779878&view=diff
==============================================================================
--- apr/apr/trunk/strmatch/apr_strmatch.c (original)
+++ apr/apr/trunk/strmatch/apr_strmatch.c Fri May 29 07:47:52 2009
@@ -103,13 +103,13 @@
     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;



Mime
View raw message