Explicit NULL dereference (src/backend/utils/adt/ruleutils.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Explicit NULL dereference (src/backend/utils/adt/ruleutils.c)
Date: 2020-10-31 14:49:07
Message-ID: CAEudQApoA=tMTic6xEPYP_hsNZ8XtToVThK_0x7D_aFQYowq3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Per Coverity.

make_ruledef function can dereference a NULL pointer (actions),
if "ev_qual" is provided and "actions" does not exist.

The comment there is contradictory: " /* these could be nulls */ "
Because if "ev_qual" is not null, "actions" cannot be either.

Solution proposed merely as a learning experience.

regards,
Ranier Vilela

Attachment Content-Type Size
fix_explicit_null_dereference_ruleutils.patch application/octet-stream 676 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2020-10-31 16:35:18 Re: public schema default ACL
Previous Message Ranier Vilela 2020-10-31 14:40:53 Dereference before NULL check (src/backend/storage/ipc/latch.c)