Possible pointer dereference - Mailing list pgsql-hackers

From Gaetano Mendola
Subject Possible pointer dereference
Date
Msg-id CAJycT5rs38g6Vzz1uiXqH03SSrYJKzVgDPp=H2jSjxExFvze-Q@mail.gmail.com
Whole thread Raw
Responses Re: Possible pointer dereference
List 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

pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: Re: pg_upgrade resets timeline to 1
Next
From: Tom Lane
Date:
Subject: Re: optimizing vacuum truncation scans