Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aXZ5B-0000g7-PP for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Feb 2016 18:50:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aXZ5A-0000ba-90 for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Feb 2016 18:50:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aXZ3p-0007Sh-56 for pgsql-hackers@postgresql.org; Sun, 21 Feb 2016 18:48:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aXZ3m-0002cP-2d for pgsql-hackers@postgresql.org; Sun, 21 Feb 2016 18:48:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u1LImgJm013546; Sun, 21 Feb 2016 13:48:42 -0500 From: Tom Lane To: Stephen Frost cc: Joe Conway , pgsql-hackers@postgresql.org Subject: Re: [COMMITTERS] pgsql: Cosmetic improvements in new config_info code. In-reply-to: <20160221183718.GT3331@tamriel.snowman.net> References: <56C9FF4F.7010603@joeconway.com> <20160221183718.GT3331@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Sun, 21 Feb 2016 13:37:18 -0500" Date: Sun, 21 Feb 2016 13:48:42 -0500 Message-ID: <13545.1456080522@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Stephen Frost 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