Changeset 19430 in webkit


Ignore:
Timestamp:
Feb 6, 2007 8:41:45 AM (17 years ago)
Author:
brmorris
Message:

vbradley, reviewed by Yongjun.

DESC: Fixed the stack size and pcre stack overflow ALAA-6XSF7U
Limit the number recursions that are allowed in match().
http://bugs.webkit.org/show_bug.cgi?id=12611

Location:
S60/branches/3.1m
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/JavaScriptCore/ChangeLog

    r19372 r19430  
     1vbradley, reviewed by Yongjun.
     2        DESC: Fixed the stack size and pcre stack overflow ALAA-6XSF7U
     3        Limit the number recursions that are allowed in match().
     4        http://bugs.webkit.org/show_bug.cgi?id=12611
     5
     6        * group/JavaScriptCore.mmp:
     7        * pcre/pcre.c:
     8        (match):
     9
    110yongjzha, Reviewed by zalan.
    211        DESC: backport google.com/ig refreshing memory leak fix in <http://bugs.webkit.org/show_bug.cgi?id=10773> PPEN-6QYG7L
  • S60/branches/3.1m/JavaScriptCore/group/JavaScriptCore.mmp

    r14719 r19430  
    3232
    3333EPOCALLOWDLLDATA
     34// heap size 20K - 16M
    3435EPOCHEAPSIZE 0x5000 0x1000000
     36// stack size 64K
     37epocstacksize 0x10000
    3538
    3639#if defined(ARMCC)
  • S60/branches/3.1m/JavaScriptCore/pcre/pcre.c

    r14549 r19430  
    36493649
    36503650
     3651#if NOKIA_CHANGES
     3652// Prototype match_internal()
     3653static BOOL
     3654match_internal(register const ichar *eptr, register const uschar *ecode,
     3655               int offset_top, match_data *md, unsigned long int ims,
     3656               eptrblock *eptrb, int flags);
    36513657
    36523658/*************************************************
     
    36733679Returns:       TRUE if matched
    36743680*/
    3675 
    36763681static BOOL
    36773682match(register const ichar *eptr, register const uschar *ecode,
     
    36793684  int flags)
    36803685{
     3686    static int matchcount = 0;
     3687    static int matchcountMax = 0;
     3688    BOOL err;
     3689
     3690    if ( matchcountMax >= 250 )
     3691        {
     3692        return FALSE;
     3693        }
     3694
     3695    ++matchcount;
     3696
     3697    if ( matchcountMax < matchcount )
     3698        {
     3699        matchcountMax = matchcount;
     3700        }
     3701       
     3702    err = match_internal(eptr, ecode, offset_top, md, ims, eptrb, flags);
     3703
     3704    --matchcount;
     3705    if ( matchcount <= 0 )
     3706        {
     3707        matchcountMax = 0;
     3708        }
     3709
     3710    return err;
     3711}
     3712#endif  // end of NOKIA_CHANGES
     3713
     3714/*************************************************
     3715*         Match from current position            *
     3716*************************************************/
     3717
     3718/* On entry ecode points to the first opcode, and eptr to the first character
     3719in the subject string, while eptrb holds the value of eptr at the start of the
     3720last bracketed group - used for breaking infinite loops matching zero-length
     3721strings.
     3722
     3723Arguments:
     3724   eptr        pointer in subject
     3725   ecode       position in code
     3726   offset_top  current top pointer
     3727   md          pointer to "static" info for the match
     3728   ims         current /i, /m, and /s options
     3729   eptrb       pointer to chain of blocks containing eptr at start of
     3730                 brackets - for testing for empty matches
     3731   flags       can contain
     3732                 match_condassert - this is an assertion condition
     3733                 match_isgroup - this is the start of a bracketed group
     3734
     3735Returns:       TRUE if matched
     3736*/
     3737
     3738#if NOKIA_CHANGES
     3739static BOOL
     3740match_internal(register const ichar *eptr, register const uschar *ecode,
     3741  int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
     3742  int flags)
     3743#else
     3744match(register const ichar *eptr, register const uschar *ecode,
     3745  int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb,
     3746  int flags)
     3747#endif
     3748{
     3749
    36813750unsigned long int original_ims = ims;   /* Save for resetting on ')' */
    36823751eptrblock newptrb;
     
    45324601          ichar c1 = *ecode++;
    45334602#endif
    4534                         {
     4603            {
    45354604          ichar c2 = *eptr++;
    45364605          if (MAPCHAR(md->lcc, c1) != MAPCHAR(md->lcc, c2))
    45374606            return FALSE;
    45384607          }
    4539                   }
     4608          }
    45404609        }
    45414610      else
     
    46234692          if (i >= max || eptr >= md->end_subject)
    46244693            return FALSE;
    4625                         {
     4694            {
    46264695          ichar c2 = *eptr++;
    46274696          if (c != MAPCHAR(md->lcc, c2))
    46284697            return FALSE;
    4629                         }
     4698            }
    46304699          }
    46314700        /* Control never gets here */
     
    46834752    case OP_NOT: {
    46844753    if (eptr >= md->end_subject) return FALSE;
    4685           {
     4754      {
    46864755#if PCRE_UTF16
    46874756    int c = (ecode[1] << 8) | ecode[2];
     
    47014770      }
    47024771    }
    4703           }
     4772      }
    47044773    break;
    47054774
     
    47764845          if (i >= max || eptr >= md->end_subject)
    47774846            return FALSE;
    4778                         {
     4847            {
    47794848          ichar c2 = *eptr++;
    47804849          if (c == MAPCHAR(md->lcc, c2))
    47814850            return FALSE;
    4782                         }
     4851            }
    47834852          }
    47844853        /* Control never gets here */
  • S60/branches/3.1m/WebCore/ChangeLog

    r19405 r19430  
     1vbradley, reviewed by Yongjun.
     2        DESC: Fixed the stack size and pcre stack overflow ALAA-6XSF7U
     3        Limit the number recursions that are allowed in match().
     4        http://bugs.webkit.org/show_bug.cgi?id=12611
     5
     6
     7        WARNING: NO TEST CASES ADDED OR CHANGED
     8
     9        * group/WebCore.mmp:
     10
    111bujtas, Reviewed by yongjun.
    212        DESC: browser is crashing if it is closed while a page is loading and closing and opening a new window crashes the browser as well TMCN-6XRQP2
  • S60/branches/3.1m/WebCore/group/WebCore.mmp

    r14720 r19430  
    2525epocallowdlldata
    2626VENDORID    VID_DEFAULT
     27// stack size 64K
     28epocstacksize 0x10000
    2729
    2830LANG     SC
  • S60/branches/3.1m/WebKit/ChangeLog

    r19429 r19430  
     1vbradley, reviewed by Yongjun.
     2        DESC: Fixed the stack size and pcre stack overflow ALAA-6XSF7U
     3        Limit the number recursions that are allowed in match().
     4        http://bugs.webkit.org/show_bug.cgi?id=12611
     5
     6        * group/webkit.mmp:
     7
    18bujtas, reviewed by yongjun.
    29        DESC: closing the window while the page is loading still crashes the browser TMCN-6XRQP2
  • S60/branches/3.1m/WebKit/group/webkit.mmp

    r16325 r19430  
    5353CAPABILITY  CAP_GENERAL_DLL
    5454EPOCALLOWDLLDATA
     55// stack size 64K
     56epocstacksize 0x10000
    5557
    5658MACRO __OOM__
Note: See TracChangeset for help on using the changeset viewer.