~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to regex/regcomp.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
        CHARSET_INFO *charset;  /* for ctype things  */
32
32
};
33
33
 
 
34
/* Check if there is enough stack space for recursion. */
 
35
my_regex_stack_check_t my_regex_enough_mem_in_stack= NULL;
 
36
 
34
37
#include "regcomp.ih"
35
38
 
36
39
static char nuls[10];           /* place to point scanner in event of error */
117
120
#       define  GOODFLAGS(f)    ((f)&~REG_DUMP)
118
121
#endif
119
122
 
120
 
        my_regex_init(charset); /* Init cclass if neaded */
 
123
        my_regex_init(charset, NULL);   /* Init cclass if neaded */
121
124
        preg->charset=charset;
122
125
        cflags = GOODFLAGS(cflags);
123
126
        if ((cflags&REG_EXTENDED) && (cflags&REG_NOSPEC))
222
225
                /* do a bunch of concatenated expressions */
223
226
                conc = HERE();
224
227
                while (MORE() && (c = PEEK()) != '|' && c != stop)
225
 
                        p_ere_exp(p);
 
228
                {
 
229
                  if (my_regex_enough_mem_in_stack &&
 
230
                      my_regex_enough_mem_in_stack())
 
231
                  {
 
232
                    SETERROR(REG_ESPACE);
 
233
                    return;
 
234
                  }
 
235
                  p_ere_exp(p);
 
236
                }
226
237
                if(REQUIRE(HERE() != conc, REG_EMPTY)) {}/* require nonempty */
227
238
 
228
239
                if (!EAT('|'))
690
701
        case '-':
691
702
                SETERROR(REG_ERANGE);
692
703
                return;                 /* NOTE RETURN */
693
 
                break;
694
704
        default:
695
705
                c = '\0';
696
706
                break;
1564
1574
register struct re_guts *g;
1565
1575
{
1566
1576
        register sop *scan;
1567
 
        sop *start;
1568
 
        register sop *newstart;
 
1577
        sop *UNINIT_VAR(start);
 
1578
        register sop *UNINIT_VAR(newstart);
1569
1579
        register sopno newlen;
1570
1580
        register sop s;
1571
1581
        register char *cp;
1572
1582
        register sopno i;
1573
 
        LINT_INIT(start); LINT_INIT(newstart);
 
1583
 
1574
1584
        /* avoid making error situations worse */
1575
1585
        if (p->error != 0)
1576
1586
                return;