From: Pierre Ducroquet <p.psql@pinaraf.info>
To: pgsql-hackers@postgresql.org
Subject: Re: function lca('{}'::ltree[]) caused DB Instance crash
Date: Fri, 13 Jul 2018 12:48:35 +0200
Message-ID: <4285558.KOck4HGOto@peanuts2> (raw)
In-Reply-To: <5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com>
References: <5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com>
On Friday, July 13, 2018 12:09:20 PM CEST 李海龙 wrote:
> HI,Oleg && pgsql-hackers
>
> Plese help me to check this is a bug of ltree?
>
Hi
There is indeed a bug. The _lca function in _ltree_op.c tries to allocate 0
bytes of memory, doesn't initialize it and dereference it in lca_inner.
The attached basic patch fixes it.
Regards
Pierre
Attachments:
0001-Fix-segfault-with-lca-ltree.patch (text/x-patch, 0B) download
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: p.psql@pinaraf.info, pgsql-hackers@postgresql.org
Subject: Re: function lca('{}'::ltree[]) caused DB Instance crash
In-Reply-To: <4285558.KOck4HGOto@peanuts2>
References: <5b0d8e4f-f2a3-1305-d612-e00e35a7be66@qunar.com> <4285558.KOck4HGOto@peanuts2>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox