Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tX0Km-003E9w-ON for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Jan 2025 15:57:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tX0Jm-000f0t-D5 for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Jan 2025 15:56:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tX0Jm-000evV-2R for pgsql-bugs@lists.postgresql.org; Sun, 12 Jan 2025 15:56:02 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tX0Jk-00017K-2t for pgsql-bugs@lists.postgresql.org; Sun, 12 Jan 2025 15:56:01 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 50CFtuOw286765; Sun, 12 Jan 2025 10:55:56 -0500 From: Tom Lane To: Daniel Gustafsson cc: Laurenz Albe , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18769: ldapscheme is not displayed in pg_hba_file_rules In-reply-to: References: <18769-dd8610cbc0405172@postgresql.org> <513a15b5ff69d6023b57e78bbcf5a7c17180cedc.camel@cybertec.at> <57d4c723872ae41562dee14c52888167becf9a1f.camel@cybertec.at> Comments: In-reply-to Daniel Gustafsson message dated "Fri, 10 Jan 2025 09:02:17 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <286763.1736697356.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 12 Jan 2025 10:55:56 -0500 Message-ID: <286764.1736697356@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Daniel Gustafsson writes: > I'm planning to do it today, so no need to add it. Thanks! Our weekly Coverity run complained about this in all branches: *** CID 181934: Memory - corruptions (OVERRUN) /srv/coverity/git/pgsql-git/13stable/src/backend/libpq/hba.c: 2368 in geth= ba_options() 2362 if (hba->ldapsearchfilter) 2363 options[noptions++] =3D 2364 CStringGetTextDatum(psprintf("ldapsearchfilter=3D%s", 2365 hba->ldapsearchfilter)); 2366 = 2367 if (hba->ldapscope) >>> CID 181934: Memory - corruptions (OVERRUN) >>> Overrunning array "options" of 14 8-byte elements at element index= 14 (byte offset 119) using index "noptions++" (which evaluates to 14). 2368 options[noptions++] =3D 2369 CStringGetTextDatum(psprintf("ldapscope=3D%d", hba->ldapscope= )); 2370 } 2371 = 2372 if (hba->auth_method =3D=3D uaRADIUS) 2373 { Looks like you should have increased MAX_HBA_OPTIONS. The comment just above that macro needs work too. regards, tom lane