Possible pointer dereference

From: Gaetano Mendola <mendola(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Possible pointer dereference
Date: 2015-05-27 20:07:00
Message-ID: CAJycT5rs38g6Vzz1uiXqH03SSrYJKzVgDPp=H2jSjxExFvze-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I'm playing with a static analyzer and it's giving out some real error
analyzing postgresql code base like the following one

src/backend/access/transam/commit_ts.c
return *ts != 0 // line 321
but a few line up (line 315) ts is checked for null, so either is not
needed to check for null or *ts can lead to a null pointer dereference.
Same happens a few line later lines 333 and 339

Regards
Gaetano

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-05-27 20:33:52 Re: optimizing vacuum truncation scans
Previous Message boix 2015-05-27 20:06:26 Improving GEQO