Re: [PATCH][BUG FIX] Unsafe access pointers.

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [PATCH][BUG FIX] Unsafe access pointers.
Дата
Msg-id 20191118174204.GA24784@alvherre.pgsql
обсуждение исходный текст
Ответ на [PATCH][BUG FIX] Unsafe access pointers.  (Ranier Vilela <ranier_gyn@hotmail.com>)
Список pgsql-hackers
On 2019-Nov-15, Ranier Vilela wrote:

> Hi,
> Last time, I promise.
> 
> It's probably not happening, but it can happen, I think.

This patch assumes that anything can happen after elog(ERROR).  That's
wrong -- under ERROR or higher, elog() (as well as ereport) never
returns to the caller.  If this was possible, there would be thousands
of places that would need to be patched, all over the server code.  But
it's not.

>      /* Fetch opclass information */
>      classtup = SearchSysCache1(CLAOID, ObjectIdGetDatum(opclassoid));
> -    if (!HeapTupleIsValid(classtup))
> +    if (!HeapTupleIsValid(classtup)) {
>          elog(ERROR, "cache lookup failed for operator class %u", opclassoid);
> +        return false;
> +    }


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Invisible PROMPT2
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Reverse collations (initially for making keyset pagination cover more cases)