pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #18742: /src/backend/rewrite/rewriteHandler.c
2+ messages / 2 participants
[nested] [flat]

* BUG #18742: /src/backend/rewrite/rewriteHandler.c
@ 2024-12-09 11:23 PG Bug reporting form <noreply@postgresql.org>
  2024-12-09 15:50 ` Re: BUG #18742: /src/backend/rewrite/rewriteHandler.c Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2024-12-09 11:23 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: dan-eli@mail.ru

The following bug has been logged on the website:

Bug reference:      18742
Logged by:          Daniel Elishakov
Email address:      dan-eli@mail.ru
PostgreSQL version: 16.4
Operating system:   ubuntu 20.04
Description:        

Deref of view->rd_rules->numLocks takes place without checking
view->rd_rules for NULL. The check rel->rd_rules for NULL above leaves an
opportunity for calling get_view_query() function. During the initialization
and execution rd_rules field of Relation structure is NULL.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #18742: /src/backend/rewrite/rewriteHandler.c
  2024-12-09 11:23 BUG #18742: /src/backend/rewrite/rewriteHandler.c PG Bug reporting form <noreply@postgresql.org>
@ 2024-12-09 15:50 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2024-12-09 15:50 UTC (permalink / raw)
  To: dan-eli@mail.ru; +Cc: pgsql-bugs@lists.postgresql.org

PG Bug reporting form <noreply@postgresql.org> writes:
> Deref of view->rd_rules->numLocks takes place without checking
> view->rd_rules for NULL. The check rel->rd_rules for NULL above leaves an
> opportunity for calling get_view_query() function. During the initialization
> and execution rd_rules field of Relation structure is NULL.

The preceding "Assert(view->rd_rel->relkind == RELKIND_VIEW)"
should provide sufficient assurance that the Relation has
an rd_rules entry.  If it does not, well, the ensuing core dump
would have about the same result as "Assert(view->rd_rules != NULL)".
So I feel no need to add any additional checks there.

The short answer is that it's caller error if this function is
executed on a non-view, and there is no reason to believe that
any such bug exists.  This sort of microscopic analysis that
doesn't take things like that into account isn't terribly useful.
(Of course, if you can demonstrate a real case whereby this is
reached, that would be interesting.)

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-12-09 15:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-09 11:23 BUG #18742: /src/backend/rewrite/rewriteHandler.c PG Bug reporting form <noreply@postgresql.org>
2024-12-09 15:50 ` Tom Lane <tgl@sss.pgh.pa.us>

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