Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3
Date
Msg-id 445119.1788062647@sss.pgh.pa.us
Whole thread
In response to Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3  (Andrey Rachitskiy <pl0h0yp1@gmail.com>)
List pgsql-bugs
Alexander Lakhin <exclusion@gmail.com> writes:
> I discovered one more issue in this area. This OOM condition emulation:
> --- a/src/backend/snowball/libstemmer/api.c
> +++ b/src/backend/snowball/libstemmer/api.c
> @@ -6,3 +6,3 @@ extern struct SN_env * SN_new_env(int alloc_size)
>   {
> -    struct SN_env * z = (struct SN_env *) malloc(alloc_size);
> +    struct SN_env * z = (rand() % 2 == 0) ? NULL : (struct SN_env *) malloc(alloc_size);
>       if (z == NULL) return NULL;

> leads to `make check` crashes like:

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?

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19644: byteaout, float8out and float4out are marked IMMUTABLE but depend on GUCs
Next
From: Tom Lane
Date:
Subject: Re: BUG #19595: Three memory-safety defects in src/backend/tsearch/spell.c (dictionary loader), PG 18.3