[PATCH] dynahash: add memory allocation failure check - Mailing list pgsql-hackers

From m.korotkov@postgrespro.ru
Subject [PATCH] dynahash: add memory allocation failure check
Date
Msg-id 219bdccd460510efaccf90b57e5e5ef2@postgrespro.ru
Whole thread Raw
Responses Re: [PATCH] dynahash: add memory allocation failure check
Re: [PATCH] dynahash: add memory allocation failure check
Re: [PATCH] dynahash: add memory allocation failure check
List pgsql-hackers
Hi all,
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.
---
Best regards, Korotkov Maksim
PostgresPro
m.korotkov@postgrespro.ru
Attachment

pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Fix premature xmin advancement during fast forward decoding
Next
From: Jelte Fennema-Nio
Date:
Subject: Re: What's our minimum supported Python version?