Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mP7xi-0008D4-Cd for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Sep 2021 18:42:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mP7xg-0000K2-5I for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Sep 2021 18:42:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mP7xf-0000Jt-Tq for pgsql-hackers@lists.postgresql.org; Sat, 11 Sep 2021 18:42:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mP7xd-0004f9-2R for pgsql-hackers@postgresql.org; Sat, 11 Sep 2021 18:42:47 +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 18BIggj6105912; Sat, 11 Sep 2021 14:42:42 -0400 From: Tom Lane To: Jaime Casanova cc: pgsql-hackers@postgresql.org Subject: Re: new regexp_*(text, text, int) functions crash In-reply-to: <20210911180357.GA6870@ahch-to> References: <20210911180357.GA6870@ahch-to> Comments: In-reply-to Jaime Casanova message dated "Sat, 11 Sep 2021 13:03:57 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <105910.1631385762.1@sss.pgh.pa.us> Date: Sat, 11 Sep 2021 14:42:42 -0400 Message-ID: <105911.1631385762@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jaime Casanova writes: > BTW, this only happens when the third parameter is large. Here is an > example that consistently crash here: > select regexp_count('jaime.casanova', 'valid', 102481); Hah ... pg_regexec has never had a check that the search start position is sane. Will fix. regards, tom lane