patch re-added

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: patch re-added
Date: 2000-01-12 02:44:33
Message-ID: 200001120244.VAA07730@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom, I see you found the case where the array was being written past the
end, or so I thought. I now see I was wrong:

/*
* Need to make these arrays large enough to be sure there is a
* terminating 0 at the end of each one.
*/
info->classlist = (Oid *) palloc(sizeof(Oid) * (INDEX_MAX_KEYS+1));
info->indexkeys = (int *) palloc(sizeof(int) * (INDEX_MAX_KEYS+1));
info->ordering = (Oid *) palloc(sizeof(Oid) * (INDEX_MAX_KEYS+1));
...

for (i = 0; i < INDEX_MAX_KEYS; i++)
info->indexkeys[i] = index->indkey[i];
+ info->indexkeys[INDEX_MAX_KEYS] = 0;
for (i = 0; i < INDEX_MAX_KEYS; i++)
info->classlist[i] = index->indclass[i];
+ info->classlist[INDEX_MAX_KEYS] = (Oid) 0;

Thanks again, Tom.

Vadim used to bail me out of the jams I get into. Tom, looks like
you're my new savior.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-01-12 03:30:25 Re: [HACKERS] Re: [SQL] createdb -D xxxx not working
Previous Message Don Baccus 2000-01-12 02:15:39 bug in 6.5.3...