BUG #18786: Pointer bmr.rel, dereferenced by passing as 1st parameter to function is checked for NULL later

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dan-eli(at)mail(dot)ru
Subject: BUG #18786: Pointer bmr.rel, dereferenced by passing as 1st parameter to function is checked for NULL later
Date: 2025-01-28 14:08:55
Message-ID: 18786-d53753af98dc9475@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18786
Logged by: Daniel Elishakov
Email address: dan-eli(at)mail(dot)ru
PostgreSQL version: 16.6
Operating system: ubuntu 20.04
Description:

I suggest the following patch to fix this issue

@@ -1872,7 +1872,7 @@ ExtendBufferedRelShared(BufferManagerRelation bmr,
* Note that another backend might have extended the relation by the
time
* we get the lock.
*/
- if (!(flags & EB_SKIP_EXTENSION_LOCK))
+ if (!(flags & EB_SKIP_EXTENSION_LOCK) && bmr.rel != NULL)
{
LockRelationForExtension(bmr.rel, ExclusiveLock);
if (bmr.rel)
the problem is the same as in bug-report #18785

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-01-28 14:32:06 BUG #18787: pointer te->defn not checked for NULL
Previous Message PG Bug reporting form 2025-01-28 13:58:13 BUG #18785: Pointer bmr.rel, dereferenced by passing as 1st parameter to function is checked for NULL later