~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to erts/emulator/pcre/pcre_compile.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
 
93
93
#define COMPILE_WORK_SIZE (4096)
94
94
 
 
95
/* The overrun tests check for a slightly smaller size so that they detect the
 
96
overrun before it actually does run off the end of the data block. */
 
97
 
 
98
#define WORK_SIZE_CHECK (COMPILE_WORK_SIZE - 100)
 
99
 
95
100
 
96
101
/* Table for handling escaped characters in the range '0'-'z'. Positive returns
97
102
are simple data values; negative values are for special things like \d and so
2445
2450
#ifdef DEBUG
2446
2451
    if (code > cd->hwm) cd->hwm = code;                 /* High water info */
2447
2452
#endif
2448
 
    if (code > cd->start_workspace + COMPILE_WORK_SIZE) /* Check for overrun */
 
2453
    if (code > cd->start_workspace + WORK_SIZE_CHECK)   /* Check for overrun */
2449
2454
      {
2450
2455
      *errorcodeptr = ERR52;
2451
2456
      goto FAILED;
2494
2499
  /* In the real compile phase, just check the workspace used by the forward
2495
2500
  reference list. */
2496
2501
 
2497
 
  else if (cd->hwm > cd->start_workspace + COMPILE_WORK_SIZE)
 
2502
  else if (cd->hwm > cd->start_workspace + WORK_SIZE_CHECK)
2498
2503
    {
2499
2504
    *errorcodeptr = ERR52;
2500
2505
    goto FAILED;
4820
4825
        both phases.
4821
4826
 
4822
4827
        If we are not at the pattern start, compile code to change the ims
4823
 
        options if this setting actually changes any of them. We also pass the
4824
 
        new setting back so that it can be put at the start of any following
4825
 
        branches, and when this group ends (if we are in a group), a resetting
4826
 
        item can be compiled. */
 
4828
        options if this setting actually changes any of them, and reset the
 
4829
        greedy defaults and the case value for firstbyte and reqbyte. */
4827
4830
 
4828
4831
        if (*ptr == ')')
4829
4832
          {
4831
4834
               (lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
4832
4835
            {
4833
4836
            cd->external_options = newoptions;
4834
 
            options = newoptions;
4835
4837
            }
4836
4838
         else
4837
4839
            {
4840
4842
              *code++ = OP_OPT;
4841
4843
              *code++ = newoptions & PCRE_IMS;
4842
4844
              }
4843
 
 
4844
 
            /* Change options at this level, and pass them back for use
4845
 
            in subsequent branches. Reset the greedy defaults and the case
4846
 
            value for firstbyte and reqbyte. */
4847
 
 
4848
 
            *optionsptr = options = newoptions;
4849
4845
            greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
4850
4846
            greedy_non_default = greedy_default ^ 1;
4851
 
            req_caseopt = ((options & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;
 
4847
            req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS : 0;
4852
4848
            }
4853
4849
 
 
4850
          /* Change options at this level, and pass them back for use
 
4851
          in subsequent branches. When not at the start of the pattern, this
 
4852
          information is also necessary so that a resetting item can be
 
4853
          compiled at the end of a group (if we are in a group). */
 
4854
 
 
4855
          *optionsptr = options = newoptions;
4854
4856
          previous = NULL;       /* This item can't be repeated */
4855
4857
          continue;              /* It is complete */
4856
4858
          }