~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/backend/regex/regc_nfa.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29
29
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
30
 *
31
 
 * $PostgreSQL: pgsql/src/backend/regex/regc_nfa.c,v 1.6 2008/02/14 17:33:37 tgl Exp $
 
31
 * $PostgreSQL: pgsql/src/backend/regex/regc_nfa.c,v 1.7 2009/06/11 14:49:01 momjian Exp $
32
32
 *
33
33
 *
34
34
 * One or two things that technically ought to be in here
93
93
 * TooManyStates - checks if the max states exceeds the compile-time value
94
94
 */
95
95
static int
96
 
TooManyStates(struct nfa *nfa)
 
96
TooManyStates(struct nfa * nfa)
97
97
{
98
98
        struct nfa *parent = nfa->parent;
99
99
        size_t          sz = nfa->size;
112
112
 * IncrementSize - increases the tracked size of the NFA and its parents.
113
113
 */
114
114
static void
115
 
IncrementSize(struct nfa *nfa)
 
115
IncrementSize(struct nfa * nfa)
116
116
{
117
117
        struct nfa *parent = nfa->parent;
118
118
 
128
128
 * DecrementSize - decreases the tracked size of the NFA and its parents.
129
129
 */
130
130
static void
131
 
DecrementSize(struct nfa *nfa)
 
131
DecrementSize(struct nfa * nfa)
132
132
{
133
133
        struct nfa *parent = nfa->parent;
134
134
 
856
856
 
857
857
        /*
858
858
         * DGP 2007-11-15: Cloning a state with a circular constraint on its list
859
 
         * of outs can lead to trouble [Tcl Bug 1810038], so get rid of them first.
 
859
         * of outs can lead to trouble [Tcl Bug 1810038], so get rid of them
 
860
         * first.
860
861
         */
861
862
        for (a = from->outs; a != NULL; a = nexta)
862
863
        {
998
999
        }
999
1000
 
1000
1001
        /*
1001
 
         * DGP 2007-11-15: Here we duplicate the same protections as appear
1002
 
         * in pull() above to avoid troubles with cloning a state with a
1003
 
         * circular constraint on its list of ins.  It is not clear whether
1004
 
         * this is necessary, or is protecting against a "can't happen".
1005
 
         * Any test case that actually leads to a freearc() call here would
1006
 
         * be a welcome addition to the test suite.
 
1002
         * DGP 2007-11-15: Here we duplicate the same protections as appear in
 
1003
         * pull() above to avoid troubles with cloning a state with a circular
 
1004
         * constraint on its list of ins.  It is not clear whether this is
 
1005
         * necessary, or is protecting against a "can't happen". Any test case
 
1006
         * that actually leads to a freearc() call here would be a welcome
 
1007
         * addition to the test suite.
1007
1008
         */
1008
1009
        for (a = to->ins; a != NULL; a = nexta)
1009
1010
        {
1143
1144
        {
1144
1145
                progress = 0;
1145
1146
                for (s = nfa->states; s != NULL && !NISERR() &&
1146
 
                                 s->no != FREESTATE; s = nexts)
 
1147
                         s->no != FREESTATE; s = nexts)
1147
1148
                {
1148
1149
                        nexts = s->next;
1149
1150
                        for (a = s->outs; a != NULL && !NISERR(); a = nexta)