Thread: patch re-added

patch re-added

From
Bruce Momjian
Date:
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
eachone.        */       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@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026