public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Коротков Максим <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] snowball: fix potential NULL dereference
Date: Tue, 11 Feb 2025 11:53:37 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <1d1a46-67ab1000-21-80c451@83151435>
References: <1d1a46-67ab1000-21-80c451@83151435>

=?utf-8?q?=D0=9A=D0=BE=D1=80=D0=BE=D1=82=D0=BA=D0=BE=D0=B2_=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?= <[email protected]> writes:
> I found the case of potential NULL pointer dereference.
> In snowball/libstemmer/api.c if we transfer control to the SN_create_env() function
> by using the error label when there is a memory allocation error of z->p or z->S,
> we can then dereference the NULL pointer z->S in the function SN_close_env().
> Added the pointer check for avoiding a potential problem.

I believe you are right: OOM partway through SN_create_env would fail.
However, backend/snowball is not our code so applying our own local
patch is not the way to fix it.  You should report this upstream;
see src/backend/snowball/README.

(Whenever they apply the patch, we should then re-sync...)

			regards, tom lane






view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: [PATCH] snowball: fix potential NULL dereference
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox