Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> Using the int_array_enum function from contrib/intagg I can crash the 8.0.2 backend when I pass it an empty array.
Man, we've had a few problems with that thing, haven't we?
I patched it along these lines:
*** contrib/intagg/int_aggregate.c.orig Thu Apr 14 14:16:08 2005
--- contrib/intagg/int_aggregate.c Sat Apr 23 01:32:52 2005
***************
*** 242,247 ****
--- 242,250 ----
pc->p = p;
pc->flags = 0;
}
+ /* Now that we have a detoasted array, verify dimensions */
+ if (pc->p->a.ndim != 1)
+ elog(ERROR, "int_enum only accepts 1-D arrays");
pc->num = 0;
fcinfo->context = (Node *) pc;
MemoryContextSwitchTo(oldcontext);
regards, tom lane