pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: movead.li@highgo.ca <movead.li@highgo.ca>
Cc: Daniel Verite <daniel@manitou-mail.org>
Cc: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Cc: ashutosh.bapat <ashutosh.bapat@2ndquadrant.com>
Subject: Re: A bug when use get_bit() function for a long bytea string
Date: Tue, 07 Apr 2020 16:39:12 -0400
Message-ID: <17604.1586291952@sss.pgh.pa.us> (raw)
In-Reply-To: <9172.1586271763@sss.pgh.pa.us>
References: <3ae0e84f-1d80-4f98-b36e-235ebcae4ff6@manitou-mail.org>
	<2020040709294706977061@highgo.ca>
	<2020040713393391866468@highgo.ca>
	<9172.1586271763@sss.pgh.pa.us>

I wrote:
> It would be easier to get this done if you had addressed any of the
> objections to the patch as given.  Integer-overflow handling is still
> missing, and you still are assuming that it's okay to change catalog
> entries in released branches.

Since we are hard upon the feature freeze deadline, I took it on myself
to split this apart.  As far as I can see, the only part we really want
to back-patch is the adjustment of the range-limit comparisons in
byteaGetBit and byteaSetBit to use int64 arithmetic, so they don't
go wacko when the input bytea exceeds 256MB.  The other changes are
not live bugs because in current usage the estimated result size of
an encoding or decoding transform couldn't exceed 4 times 1GB.
Hence it won't overflow size_t even on 32-bit machines, thus the
check in palloc() is sufficient to deal with overlength values.
But it's worth making those changes going forward, I suppose,
in case somebody wants to deal with longer strings someday.

There were some other minor problems too, but I think I fixed
everything.

			regards, tom lane





view thread (27+ messages)

Message-ID: <17604.1586291952@sss.pgh.pa.us>
Permalink:  ../17604.1586291952@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17604.1586291952@sss.pgh.pa.us

 · 

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: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, movead.li@highgo.ca, daniel@manitou-mail.org, pgsql-hackers@lists.postgresql.org, ashutosh.bapat@2ndquadrant.com
  Subject: Re: A bug when use get_bit() function for a long bytea string
  In-Reply-To: <17604.1586291952@sss.pgh.pa.us>

* 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