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
Ответ на
Список
Дерево обсуждения
Re: empty array can crash backend using int_array_enum from contrib. Andrew - Supernews <andrew+nonews@supernews.com>
Re: empty array can crash backend using int_array_enum from contrib. Tom Lane <tgl@sss.pgh.pa.us>
Ron Mayer  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
Дата:
От: Kris Jurka
Дата:
Сообщение: V2 protocol -> 8.1 server
FAQ