[PATCH] Dereference null return value (NULL_RETURNS) (src/backend/commands/statscmds.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Dereference null return value (NULL_RETURNS) (src/backend/commands/statscmds.c)
Date: 2020-08-25 15:42:17
Message-ID: CAEudQAoMH_R0WaBvDsFL8fz_TLQ4cwhu3v8y1R-1kDsFjzxg8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

Per Coverity.

The SearchSysCache1 allows return NULL and at function AlterStatistics,
has one mistake, lack of, check of return, which enables a dereference NULL
pointer,
at function heap_modify_tuple.

While there is room for improvement.
Avoid calling SearchSysCache1 and table_open if the user "is not the owner
of the existing statistics object".

regards,
Ranier Vilela

Attachment Content-Type Size
fix_dereference_null_statscmds.patch application/octet-stream 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-08-25 15:52:40 Re: Hybrid Hash/Nested Loop joins and caching results from subplans
Previous Message Rahila 2020-08-25 15:29:37 Re: More tests with USING INDEX replident and dropped indexes