Show
Ignore:
Timestamp:
02/06/07 14:03:51 (2 years ago)
Author:
brmorris
Message:

brmorris <bradley.morrison@nokia.com>, rs'd by zalan

DESC: merge from s60/branches/3.1m to s60/trunk of r19429, r19430, r19431, r19432 and r19433

Location:
S60/trunk/JavaScriptCore
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • S60/trunk/JavaScriptCore/ChangeLog

    r17301 r19440  
     1vbradley, Reviewed by Yongjun. 
     2        DESC: Fixed the stack size and pcre stack overflow. Limit the number 
     3    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 
    1102006-10-25  yadavall  <sriram.yadavalli@nokia.com> 
    211 
  • S60/trunk/JavaScriptCore/group/JavaScriptCore.mmp

    r17301 r19440  
    3333 
    3434EPOCALLOWDLLDATA 
     35// heap size 20K - 16M 
    3536EPOCHEAPSIZE 0x5000 0x1000000 
     37// stack size 64K 
     38epocstacksize 0x10000 
    3639 
    3740#if defined(ARMCC) 
  • S60/trunk/JavaScriptCore/pcre/pcre.c

    r14549 r19440  
    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 */