Potential NULL dereference found in typecmds.c

From: Michael Mueller <mmueller(at)vigilantsw(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Potential NULL dereference found in typecmds.c
Date: 2011-07-02 18:10:00
Message-ID: BANLkTimJxL4GTprqSqoAJ7ReZs_VkUs72g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi folks,

Sentry found this error last night, and it looks serious enough to
report. The error was introduced in commit 426cafc. Here's the code
in question, starting at line 2096:

if (!found)
{
con = NULL; /* keep compiler quiet */
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("constraint \"%s\" of domain \"%s\" does not exist",
constrName, NameStr(con->conname))));
}

It sets 'con' to NULL and then in the next statement, dereferences it.
I'm not sure if it's possible to reach this path, but if it is
reachable it will cause a crash.

Best Regards,
Mike

--
Mike Mueller
Phone: (401) 405-1525
Email: mmueller(at)vigilantsw(dot)com

http://www.vigilantsw.com/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-07-02 18:37:28 Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)
Previous Message Tom Lane 2011-07-02 18:07:24 Re: Optimizing pg_trgm makesign() (was Re: WIP: Fast GiST index build)