Re: [sqlsmith] Infinite recursion in bitshift

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [sqlsmith] Infinite recursion in bitshift
Дата
Msg-id 30239.1476477079@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [sqlsmith] Infinite recursion in bitshift  (Andreas Seltenreich <seltenreich@gmx.de>)
Ответы Re: [sqlsmith] Infinite recursion in bitshift  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-hackers
Andreas Seltenreich <seltenreich@gmx.de> writes:
> Tom Lane writes:
>> Seems sane, though I wonder if it'd be better to use -INT_MAX rather
>> than -VARBITMAXLEN.

> I am undecided between those two.  -INT_MAX might be a more precise fix
> for the problem, but the extra distance to the danger zone was kind of
> soothing :-).

Yeah, might as well use the tighter limit.

Poking around in varbit.c, I noticed some other places that were assuming
that a typmod couldn't exceed VARBITMAXLEN.  anybit_typmodin() enforces
that, but there are places where a user can shove in an arbitrary integer,
eg

regression=# select "bit"(42, 2147483647);
ERROR:  invalid memory alloc request size 18446744073441116169

I fixed those too and pushed it.  Thanks for the report!
        regards, tom lane



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

Предыдущее
От: Andreas Seltenreich
Дата:
Сообщение: Re: [sqlsmith] Infinite recursion in bitshift
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: [sqlsmith] Infinite recursion in bitshift