BUG #14186: Inconsistent code modification

Started by petrum@gmail.comalmost 10 years ago2 messagesbugs
Jump to latest
#1petrum@gmail.com
petrum@gmail.com

The following bug has been logged on the website:

Bug reference: 14186
Logged by: Petru-Florin Mihancea
Email address: petrum@gmail.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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: petrum@gmail.com (#1)
Re: BUG #14186: Inconsistent code modification

petrum@gmail.com writes:

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.

Yeah, you're right. Will fix, thanks for the report!

regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs