Re: empty array can crash backend using int_array_enum from contrib.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: empty array can crash backend using int_array_enum from contrib.
Дата
Msg-id 7036.1114234851@sss.pgh.pa.us
обсуждение исходный текст
Ответ на empty array can crash backend using int_array_enum from contrib.  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Oliver Siegmar
Дата:
Сообщение: Re: BUG #1609: Bug in interval datatype for 64 Bit timestamps
Следующее
От: Kris Jurka
Дата:
Сообщение: V2 protocol -> 8.1 server