pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: dan-eli@mail.ru
Subject: BUG #18786: Pointer bmr.rel, dereferenced by passing as 1st parameter to function is checked for NULL later
Date: Tue, 28 Jan 2025 14:08:55 +0000
Message-ID: <18786-d53753af98dc9475@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18786
Logged by:          Daniel Elishakov
Email address:      dan-eli@mail.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



Message-ID: <18786-d53753af98dc9475@postgresql.org>
Permalink:  ../18786-d53753af98dc9475@postgresql.org/
Also on:    postgresql.org/message-id/18786-d53753af98dc9475@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, dan-eli@mail.ru
  Subject: Re: BUG #18786: Pointer bmr.rel, dereferenced by passing as 1st parameter to function is checked for NULL later
  In-Reply-To: <18786-d53753af98dc9475@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox