pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Joe Conway <mail@joeconway.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: [COMMITTERS] pgsql: Cosmetic improvements in new config_info code.
Date: Sun, 21 Feb 2016 13:48:42 -0500
Message-ID: <13545.1456080522@sss.pgh.pa.us> (raw)
In-Reply-To: <20160221183718.GT3331@tamriel.snowman.net>
References: <E1aXX1h-0004Yg-CB@gemulon.postgresql.org>
	<56C9FF4F.7010603@joeconway.com>
	<20160221183718.GT3331@tamriel.snowman.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Stephen Frost <sfrost@snowman.net> writes:
> * Joe Conway (mail@joeconway.com) wrote:
>> FWIW, strcpy() was being used in src/bin/pg_config/pg_config.c that I
>> started with -- does that mean we are not getting Coverity coverage of
>> src/bin?

> Coverity does run against src/bin also.  It's possible this was
> identified as an issue in pg_config.c, but, as Tom notes, it may not be
> an actual bug and might have been marked as a non-bug in Coverity.

It looks to me like the previous coding was

static char mypath[MAXPGPATH];
...
	char		path[MAXPGPATH];
...
	strcpy(path, mypath);

so Coverity probably didn't complain because it could see that the source
was also a buffer of size MAXPGPATH.  With the new arrangement it was
probably using an assumption that get_configdata() could be called with
any length of string.

I am not sure how much cross-file analysis Coverity does --- it seems to
do some, but in other cases it acts like it doesn't know anything about
the call sites.  It's possible that it did know that the existing callers
all use MAXPGPATH-sized buffers, but whined anyway on the not-unreasonable
grounds that global functions should be prepared for new callers.

			regards, tom lane


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



view thread (4+ messages)

Message-ID: <13545.1456080522@sss.pgh.pa.us>
Permalink:  ../13545.1456080522@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13545.1456080522@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, mail@joeconway.com, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Cosmetic improvements in new config_info code.
  In-Reply-To: <13545.1456080522@sss.pgh.pa.us>
  References: <E1aXX1h-0004Yg-CB@gemulon.postgresql.org> <56C9FF4F.7010603@joeconway.com> <20160221183718.GT3331@tamriel.snowman.net> <13545.1456080522@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox