Re: [BUG FIX] Uninitialized var fargtypes used.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [BUG FIX] Uninitialized var fargtypes used.
Дата
Msg-id 6021.1573493558@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [BUG FIX] Uninitialized var fargtypes used.  (Ranier Vilela <ranier_gyn@hotmail.com>)
Ответы Re: [BUG FIX] Uninitialized var fargtypes used.  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-bugs
Ranier Vilela <ranier_gyn@hotmail.com> writes:
> Can anyone check this bug fix?

> -    Oid            fargtypes[1];    /* dummy */
> +    Oid            fargtypes[1] = {InvalidOid, InvalidOid};    /* dummy */

Well, it's wrong on its face, because that array only has one element
not two.  But why do you care?  The element will never be accessed.

The only reason we declare this variable at all is that LookupFuncName
requires a non-null pointer, which if memory serves is because memcmp()
with a null pointer is formally undefined even if the count is zero,
cf commit 0a52d378b.

Maybe it would've been better to make LookupFuncName deal with the
case instead of requiring callers to do strange things.  But I don't
see any bug here.

            regards, tom lane



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

Предыдущее
От: Ranier Vilela
Дата:
Сообщение: [BUG FIX] Uninitialized var fargtypes used.
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #16106: Patch - Radius secrets always gets lowercased