[webkit-changes] cvs commit: JavaScriptCore/tests/mozilla jsDriver.pl

Geoffrey ggaren at opensource.apple.com
Sat Nov 5 20:05:50 PST 2005


ggaren      05/11/05 20:05:49

  Modified:    .        Tag: Ti-2005-009-branch ChangeLog
               pcre     Tag: Ti-2005-009-branch pcre.c
               tests/mozilla Tag: Ti-2005-009-branch jsDriver.pl
  Log:
          Reviewed by NOBODY (OOPS!).
  
          - Fixed <rdar://problem/4323773> REGRESSION (412.2-416.12): [[xxx]]
            appears on page due to JS regexp with char > 255 (5597)
            (tiddlywiki.com)
  
          Previously, we fixed a buffer overflow by returning an error when
          compiling character classes with characters > 255. But that broke
          the internet.
  
          Plan B here is to work around such classes, skipping single characters
          > 255, skipping character ranges beginning > 255, and truncating
          character ranges at 255.
  
          I removed the early returns we added and the early returns in the
          original library. Now, funky expressions compile normally, tweaked
          by our special rules.
  
          I also merged the UTF8 and UTF16 checks for out of range characters.
          I remember we kept them separate before because we were purist about
          marking off our code changes inside UTF16 #ifdefs. Since this patch
          applies equally to UTF8 and UTF16, we've already lost that innocence,
          so why not have a little fun?
  
          * ChangeLog:
          * pcre/pcre.c:
          (compile_branch):
          * tests/mozilla/jsDriver.pl: Oh, by the way, I modified this to look
          inside of $SYMROOTS/Development. Not perfect, but certainly better
          than $SYMROOTS/, which is always wrong with XCode 2.1.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.677.6.34.2.14.2.3 +33 -0     JavaScriptCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
  retrieving revision 1.677.6.34.2.14.2.2
  retrieving revision 1.677.6.34.2.14.2.3
  diff -u -r1.677.6.34.2.14.2.2 -r1.677.6.34.2.14.2.3
  --- ChangeLog	5 Nov 2005 00:13:41 -0000	1.677.6.34.2.14.2.2
  +++ ChangeLog	6 Nov 2005 04:05:44 -0000	1.677.6.34.2.14.2.3
  @@ -1,3 +1,36 @@
  +2005-11-04  Geoffrey Garen  <ggaren at apple.com>
  +
  +        Reviewed by NOBODY (OOPS!).
  +
  +        - Fixed <rdar://problem/4323773> REGRESSION (412.2-416.12): [[xxx]] 
  +          appears on page due to JS regexp with char > 255 (5597) 
  +          (tiddlywiki.com)
  +
  +        Previously, we fixed a buffer overflow by returning an error when 
  +        compiling character classes with characters > 255. But that broke 
  +        the internet.
  +
  +        Plan B here is to work around such classes, skipping single characters 
  +        > 255, skipping character ranges beginning > 255, and truncating 
  +        character ranges at 255. 
  +
  +        I removed the early returns we added and the early returns in the 
  +        original library. Now, funky expressions compile normally, tweaked 
  +        by our special rules.
  +
  +        I also merged the UTF8 and UTF16 checks for out of range characters. 
  +        I remember we kept them separate before because we were purist about 
  +        marking off our code changes inside UTF16 #ifdefs. Since this patch 
  +        applies equally to UTF8 and UTF16, we've already lost that innocence, 
  +        so why not have a little fun?
  +
  +        * ChangeLog:
  +        * pcre/pcre.c:
  +        (compile_branch):
  +        * tests/mozilla/jsDriver.pl: Oh, by the way, I modified this to look 
  +        inside of $SYMROOTS/Development. Not perfect, but certainly better 
  +        than $SYMROOTS/, which is always wrong with XCode 2.1.
  +
   === JavaScriptCore-416.14 ===
   
   2005-11-04  Geoffrey Garen  <ggaren at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.3.12.2.4.2 +17 -31    JavaScriptCore/pcre/Attic/pcre.c
  
  Index: pcre.c
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre.c,v
  retrieving revision 1.3.12.2.4.1
  retrieving revision 1.3.12.2.4.2
  diff -u -r1.3.12.2.4.1 -r1.3.12.2.4.2
  --- pcre.c	4 Nov 2005 23:26:49 -0000	1.3.12.2.4.1
  +++ pcre.c	6 Nov 2005 04:05:47 -0000	1.3.12.2.4.2
  @@ -1190,13 +1190,6 @@
           *errorptr = ERR6;
           goto FAILED;
           }
  -#if PCRE_UTF16
  -      if (c > 255)
  -        {
  -        *errorptr = ERR33;
  -        goto FAILED;
  -        }
  -#endif
             
         /* Handle POSIX class names. Perl allows a negation extension of the
         form [:^name]. A square bracket that doesn't match the syntax is
  @@ -1306,16 +1299,7 @@
               }
             }
   
  -        /* Fall through if single character, but don't at present allow
  -        chars > 255 in UTF-8 mode. */
  -
  -#ifdef SUPPORT_UTF8
  -        if (c > 255)
  -          {
  -          *errorptr = ERR33;
  -          goto FAILED;
  -          }
  -#endif
  +        /* Fall through if single character. */
           }
   
         /* A single character may be followed by '-' to form a range. However,
  @@ -1333,13 +1317,6 @@
             *errorptr = ERR6;
             goto FAILED;
             }
  -#if PCRE_UTF16
  -        if (d > 255)
  -          {
  -          *errorptr = ERR33;
  -          goto FAILED;
  -          }
  -#endif
           
           /* The second part of a range can be a single-character escape, but
           not any of the other escapes. Perl 5.6 treats a hyphen as a literal
  @@ -1350,13 +1327,6 @@
             const ichar *oldptr = ptr;
             d = check_escape(&ptr, errorptr, *brackets, options, TRUE, cd);
   
  -#ifdef SUPPORT_UTF8
  -          if (d > 255)
  -            {
  -            *errorptr = ERR33;
  -            goto FAILED;
  -            }
  -#endif
             /* \b is backslash; any other special means the '-' was literal */
   
             if (d < 0)
  @@ -1375,6 +1345,16 @@
             goto FAILED;
             }
   
  +#ifdef SUPPORT_UTF8
  +        /* start of character range is out of range -- skip range */
  +        if (c > 255)
  +            continue;
  +
  +        /* end of character range is out of range -- truncate range */
  +        if (d > 255)
  +          d = 255;
  +#endif
  +
           for (; c <= d; c++)
             {
             class[c/8] |= (1 << (c&7));
  @@ -1394,6 +1374,12 @@
   
         SINGLE_CHARACTER:
   
  +#ifdef SUPPORT_UTF8
  +      /* character is out of range -- skip it */
  +      if (c > 255)
  +        continue;
  +#endif
  +      
         class [c/8] |= (1 << (c&7));
         if ((options & PCRE_CASELESS) != 0)
           {
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.26.1  +1 -1      JavaScriptCore/tests/mozilla/jsDriver.pl
  
  Index: jsDriver.pl
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/tests/mozilla/jsDriver.pl,v
  retrieving revision 1.4
  retrieving revision 1.4.26.1
  diff -u -r1.4 -r1.4.26.1
  --- jsDriver.pl	10 Aug 2004 18:43:51 -0000	1.4
  +++ jsDriver.pl	6 Nov 2005 04:05:49 -0000	1.4.26.1
  @@ -636,7 +636,7 @@
   # get the shell command used to run kjs
   #
   sub get_kjs_engine_command {
  -    return $ENV{"SYMROOTS"} . "/testkjs";
  +    return $ENV{"SYMROOTS"} . "/Development/testkjs";
   }
   
   #
  
  
  



More information about the webkit-changes mailing list