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 1pbKN3-0001CY-Vu for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Mar 2023 12:00:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pbKN2-00021r-Ru for pgsql-bugs@arkaria.postgresql.org; Sun, 12 Mar 2023 12:00:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pbKN2-00021i-CK for pgsql-bugs@lists.postgresql.org; Sun, 12 Mar 2023 12:00:12 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pbKMv-0008MY-Jl for pgsql-bugs@lists.postgresql.org; Sun, 12 Mar 2023 12:00:11 +0000 Received: by mail-lf1-x12d.google.com with SMTP id i28so12359883lfv.0 for ; Sun, 12 Mar 2023 05:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678622403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=NHhQXsM9tOfJRqJBn5J635kT9VH0rKkeyJA5rwv7X6A=; b=OFQCwTPgfkBKk3D8u/wd+lbn836dAU7z1Woe0YwKZmQHumXzsgdVR+VAW/mnYlwfdc 4dtjgW8WpbBG4/OO17UdiNP4U6HELH8UPgPCOamKhde+orQmXBEbPxFWEs3faRAzLaSF FRbxu7tz/+eVIsqFX5Zt2qSJ6IlmQRlAto6TlM0HfnPVysvGB7b6B+lnZXgSb09O7m9d DInq/ZMqqj9TDBAtzGfKc1m1des0t24VZjtZd87iuX8R6UZ/ZK6p/Dyp+B3tP2gJ22qL G/T6ln+DGpMQEenE6+2nsJq3x08gtbgVmKneeVZJ8BtpqrZ80Q2ClXPJPwG5B5f7br2l HqNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678622403; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NHhQXsM9tOfJRqJBn5J635kT9VH0rKkeyJA5rwv7X6A=; b=1FMtuU+ciyo0/D1v8+xkr6KZNJ0oRWIZqad8ncJhktXQmDqsiOjovGeRL11Gz0B3QU 6vMec53i4KBfclfyUBc8nNqnwmOkJPAS0s6AzaUsUvhJJh7CqrcdaV7jDhM7f6Zl40nv rtVALbCj6FTdhT/2Co418sdkK6VO0w0/oGoPex7PXqZFcxS0VkSB/CHBSbhLtkBU9aJa +g4ggsnxmo4gsFT3S1UGAGcjS9rbqmW8tJYOvjyjnl9s/PgbAJL26kpLea024QAWH7ay vOOBg2UwTA4QeVI+qJLRtjjLBb/rbkXhUuyveWBcDMSb6CamCYvHM6vTgOB+uPta9uDP vzTw== X-Gm-Message-State: AO0yUKW/Qt4F85uZoO/429NpnuTGWGzPzRF4fyDoKNo4u2U+8HSg8xS2 cR0YvNsJAGP4nyeWdtsD0JCrkcSAHkARwQ== X-Google-Smtp-Source: AK7set+kBpijzoQ15i8qO7/AwjmCgdLJMgaMz2EWghWM+nXY4yNnnnSGvYCzBDGDH6CnjfL9hgHqZw== X-Received: by 2002:a05:6512:144:b0:4db:513f:fe2a with SMTP id m4-20020a056512014400b004db513ffe2amr8789460lfo.23.1678622403028; Sun, 12 Mar 2023 05:00:03 -0700 (PDT) Received: from [1.0.0.7] ([178.155.5.76]) by smtp.gmail.com with ESMTPSA id d21-20020ac24c95000000b004d8580b2470sm623328lfl.225.2023.03.12.05.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Mar 2023 05:00:02 -0700 (PDT) Message-ID: <68d98663-2adb-56ba-5072-d1c0f41cf3f0@gmail.com> Date: Sun, 12 Mar 2023 15:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17830: Incorrect memory access in trgm_regexp Content-Language: en-US To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <17830-57ff5f89bdb02b09@postgresql.org> <1190342.1678552770@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: <1190342.1678552770@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 11.03.2023 19:39, Tom Lane wrote: > Yeah, that de-duplication code is incorrectly assuming that the > NFA has more than zero arcs, which it doesn't because the regex > compiler saw that the pattern is unsatisfiable. > > Thanks for the report! I've retested trgm_regexp with all regular expressions presented in src/test/regress/sql/regex.sql and src/test/modules/test_regex/sql/test_regex.sql and found no new anomalies. Thank you for the fix! Best regards, Alexander