Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn6z5-00059J-57 for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Aug 2018 18:45:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fn6z2-0002AZ-Ut for pgsql-bugs@arkaria.postgresql.org; Tue, 07 Aug 2018 18:45:28 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn6z2-00029p-LK for pgsql-bugs@lists.postgresql.org; Tue, 07 Aug 2018 18:45:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fn6yy-00041w-0O for pgsql-bugs@lists.postgresql.org; Tue, 07 Aug 2018 18:45:27 +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 w77IjM8W028214; Tue, 7 Aug 2018 14:45:22 -0400 From: Tom Lane To: petrum@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15312: Possible access to unintended variable in "postgres/src/backend/postmaster/pgstat.c" line 2698 In-reply-to: <153363913073.1303.6518849192351268091@wrigleys.postgresql.org> References: <153363913073.1303.6518849192351268091@wrigleys.postgresql.org> Comments: In-reply-to =?utf-8?q?PG_Bug_reporting_form?= message dated "Tue, 07 Aug 2018 10:52:10 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28212.1533667522.1@sss.pgh.pa.us> Date: Tue, 07 Aug 2018 14:45:22 -0400 Message-ID: <28213.1533667522@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?utf-8?q?PG_Bug_reporting_form?= writes: > MemSet(BackendActivityBuffer, 0, size); //HERE > Shouldn't BackendActivityBufferSize be accessed in the marked line instead > of size? Yeah, I think you're right --- looks like a pretty obvious copy-and-paste oversight. It's probably harmless as long as pgstat_track_activity_query_size is at least NAMEDATALEN, but it's not good. Thanks for reporting that! regards, tom lane