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.96) (envelope-from ) id 1x0XBO-004gZA-1H for pgsql-bugs@arkaria.postgresql.org; Sun, 30 Aug 2026 04:30:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x0XBN-00CrHY-0t for pgsql-bugs@arkaria.postgresql.org; Sun, 30 Aug 2026 04:30:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x0XBN-00CrHP-02 for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 04:30:13 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x0XBJ-00000001zEW-0Vnu for pgsql-bugs@lists.postgresql.org; Sun, 30 Aug 2026 04:30:11 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-48436668d20so189528f8f.3 for ; Sat, 29 Aug 2026 21:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788064202; x=1788669002; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=tQl+u3vVrJv+EKD5CtYJnLrHsAp9FvF1LSp6ovDhWTc=; b=nF4F5CLlEhQAOgZvtyhp+c0+DxYgi/EaXftwJcmiDxHHL0dfS8ciOjOyb+UN++iWDR LZ1E/eCJcCZ+17yPr+wzZcjTWtr8YxWqZH35Z27+1fPmduBSNUGeM1BjibEkZdrd6lT/ wvgjQW/Sz2YmGq34qkCPSvtmsf2JHwfqcqWbCs0/yus+vjCF6niNtIwfiS6COs5qJ+zi dXdDZspaIF02aqfngx92Y0yFfN+8plot8cUq7dp/ayceoH3SvJsvOR+8Z19MUubM8BeZ rWYL84N5Z57hjQz3eZkDlll9oizIB5aTowF0+723d/LumEq4V9xZjBMa2LXrw67SKMGt Gwhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788064202; x=1788669002; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=tQl+u3vVrJv+EKD5CtYJnLrHsAp9FvF1LSp6ovDhWTc=; b=XT6JJbYI+BePDRTq7dD1n6t0fuseGxqK3T3ST46SW/8VRLtFW8enGRrGl4Muk/aSvb bZBugTgEfB64v8JH0majGaa5RI/eCmN+ECIh8VldW8cuNiZ7YL5QlavLX643v2BqwsRe unzO90Vu9Qc95sb3hxBBJ7sJZmpnGFgUPN37jgewMd51Ba1ahmBxsOyxYqcXt1Z1KTDZ O0y2eBkTxcdl2r7alEP/p3+Vst0uYHBWA7A/u+Pn/piYoKIz14FGV7hly3RZbY/VXaz+ oRpfHhfH6DVJJRi6tDKxWiBNHKLHvfgSoL6yorA7jEKsXfTWxQl43nhWpAdi73U1ns3f EvQA== X-Forwarded-Encrypted: i=1; AKwUvBxRK6pBz9/vFGsVG9lr587BxVxSWVZY95DTV9nu8SEHyBfYO1ffvfD6XdZCDVELPVK/aq9pN1KXtqli@lists.postgresql.org X-Gm-Message-State: AFuF++kUKLtzbiyq0+BPzOo4D3vetrrbgDz2XQMd+yCE5uh210DaiaSb +1nxThzphj46Y+Nham48zHvHJmzC7UM7Heovz3US5MzuRn17OJrGI3CL X-Gm-Gg: AYBFou1E651jkAzKRNdCvqDC9JfEdln41h8IibuqpIoiYYHAkO3DgLbpH7ympHPJm2g qwnQcCxiSi1ovzgpV+F1jSz0CHggi1O00X7PZx9TfojyCrGCAEq45fSaRFe6tA9R+Z7AdL2tjAt X0P+HI8L8ivzWNhIjcpYyKAvg8Jl7h8I1emesyMEQ8BbC7Q0+I05PoMUJOwWJNDpgkkYBbRHCn8 rAAlHIOZNO6gThyQnjswZKk1SjwqvHu5E2ruCstX+2jx9H6rE4IyCw/hTHQHQHVYaqax+l5bsAM fEHD7mE0PLA5tH2mhR+3kYA6ncxG0yEpTlLS9HVld+LPFJT3KijidTmHrB+aBkDHbUpvRJvSmBL MGKXxVnsTF1z/uJmv4hBVKTVZsIZShhheH4Wv1a7vG00m+TdLAm51vYYbQD7eReSIXd62YFxdFe 0l5/eCzI5aIXO1l5YNbMW0YVjhlWHWTrGdpsoOdJnUVCI1S26mfVRyJl8ekEWuBmY= X-Received: by 2002:a05:6000:2dc9:b0:482:ea47:4484 with SMTP id ffacd0b85a97d-482f7996044mr25677587f8f.8.1788064202026; Sat, 29 Aug 2026 21:30:02 -0700 (PDT) Received: from [192.168.0.50] ([89.149.107.253]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482fbb2e6e8sm15175558f8f.32.2026.08.29.21.30.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 29 Aug 2026 21:30:01 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------C3Kztbq5lGZoY6c8ENKCdkIb" Message-ID: <6e7563f0-48df-4639-b263-f04bc23c876b@gmail.com> Date: Sun, 30 Aug 2026 07:30:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3 To: Tom Lane Cc: Andrey Rachitskiy , michaelmalis2@gmail.com, pgsql-bugs@lists.postgresql.org References: <19595-7dc18b4e212c4757@postgresql.org> <325748.1785691547@sss.pgh.pa.us> <0f3ddeb5-0dbd-479c-9d0e-ae254758e624@gmail.com> <336527.1785701494@sss.pgh.pa.us> <2ab10d25-7dc6-4914-8aea-ca0adfbe57c3@gmail.com> <445119.1788062647@sss.pgh.pa.us> Content-Language: en-US From: Alexander Lakhin In-Reply-To: <445119.1788062647@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------C3Kztbq5lGZoY6c8ENKCdkIb Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 30.08.2026 07:04, Tom Lane wrote: > Hmph. SN_new_env itself is visibly okay with this, so the failure is > in some caller. I'm too tired to dig into it myself, but can you > identify the culprit more precisely? I think it's: static void locate_stem_module(DictSnowball *d, const char *lang) { ...                         d->stem = m->stem;                         d->z = m->create(); ... (in two places) then d->z is dereferenced in dsnowball_lexize(). Thank you for your time! Best regards, Alexander --------------C3Kztbq5lGZoY6c8ENKCdkIb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
30.08.2026 07:04, Tom Lane wrote:
Hmph.  SN_new_env itself is visibly okay with this, so the failure is
in some caller.  I'm too tired to dig into it myself, but can you
identify the culprit more precisely?

I think it's:
static void
locate_stem_module(DictSnowball *d, const char *lang)
{
...
                        d->stem = m->stem;
                        d->z = m->create();
...
(in two places)

then d->z is dereferenced in dsnowball_lexize().

Thank you for your time!

Best regards,
Alexander
--------------C3Kztbq5lGZoY6c8ENKCdkIb--