BUG #14186: Inconsistent code modification

From: petrum(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #14186: Inconsistent code modification
Date: 2016-06-13 16:31:59
Message-ID: 20160613163159.5798.52928@wrigleys.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: 14186
Logged by: Petru-Florin Mihancea
Email address: petrum(at)gmail(dot)com
PostgreSQL version: 9.4.4
Operating system: Macosx
Description:

File: postgresql-9.4.4/src/backend/catalog/aclchk.c
Function: pg_type_aclmask (line 4200)

At lines 4236, I think elttype_oid should be used and not type_oid. The code
is bellow:

tuple = SearchSysCache1(TYPEOID, ObjectIdGetDatum(elttype_oid));
if (!HeapTupleIsValid(tuple))
ereport(ERROR,
(errmsg("type with OID %u does not
exist",
type_oid))); <<<
POTENTIAL PROBLEM

It is searched for elttype_oid and thus elttype_oid should probably be
reported that is not found. Before this fragment, a similar search is done
for type_oid and type_oid is reported as not found (lines 4218-4222 but not
copied here). Flowing the same idea, elttype_oid should be used in the
presented case. I found this issue using a CodeSonar plugin I develop.

Regards,
Pepi

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message hubert depesz lubaczewski 2016-06-13 16:45:09 Re: PostgreSQL (9.3 and 9.6) eats all memory when using many tables
Previous Message Jeff Janes 2016-06-13 16:27:40 Re: PostgreSQL (9.3 and 9.6) eats all memory when using many tables