Re: [PATCH] dynahash: add memory allocation failure check

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: [PATCH] dynahash: add memory allocation failure check
Дата
Msg-id CAJ7c6TMO1nQGo_gD-0+Ry7=k-tjc1Oar_EaZOW-aq3S7H1b8vw@mail.gmail.com
обсуждение исходный текст
Ответ на [PATCH] dynahash: add memory allocation failure check  (m.korotkov@postgrespro.ru)
Список pgsql-hackers
Hi Maksim,

> I found a case of potential NULL pointer dereference.
> In src/backend/utils/hash/dynahash.c in function HTAB *hash_create() the
> result of the DynaHashAlloc() is used unsafely.
> The function DynaHashAlloc() calls MemoryContextAllocExtended() with
> MCXT_ALLOC_NO_OOM and can return a NULL pointer.
> Added the pointer check for avoiding a potential problem.

Thanks for the patch. It looks correct to me.

I didn't check if it needs to be back-ported and if it does - to how
many branches.

-- 
Best regards,
Aleksander Alekseev



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