Re: BUG #17300: Server crashes on deserializing text multirange

Alexander Korotkov <aekorotkov@gmail.com>

From: Alexander Korotkov <aekorotkov@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Paul A Jungwirth <pj@illuminatedcomputing.com>, Alexander Law <exclusion@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-12-06T19:39:34Z
Lists: pgsql-bugs
On Thu, Dec 2, 2021 at 1:39 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > The following query:
>
> > select ('[\"\\\\\",\"\\\\' || repeat('a', 200) ||
> > '\"]')::textrange::textmultirange
>
> > leads to the server crash with the following stacktrace:
>
> I think the problem here is that the range bound values inside the
> multirange are supposed to be aligned (at least, write_multirange_data
> thinks so) but multirange_get_range isn't accounting for the alignment
> padding between the two values it extracts.  In this example that
> causes it to extract an insane length for the second value.
>
> If so, this would indicate extremely slipshod testing of the multirange
> stuff, because the breakage is necessarily reached by multirange_out.

Sorry for the delay.  I'm going to fix this in the next couple of days.

------
Regards,
Alexander Korotkov



Commits

  1. Fix alignment in multirange_get_range() function