Re: Error in calculating length of encoded base64 string

2023-08-26 Thread Alvaro Herrera
On 2023-Jun-09, Tom Lane wrote: > Gurjeet Singh writes: > > On Thu, Jun 8, 2023 at 7:35 AM Tom Lane wrote: > >> This bug is very ancient, dating to commit 79d78bb26 which > >> added encode.c. (The other instances were presumably copied > >> from there.) Still, it doesn't quite seem worth back-

Re: Error in calculating length of encoded base64 string

2023-06-09 Thread Dagfinn Ilmari Mannsåker
Tom Lane writes: > Gurjeet Singh writes: >> On Thu, Jun 8, 2023 at 7:35 AM Tom Lane wrote: >>> This bug is very ancient, dating to commit 79d78bb26 which >>> added encode.c. (The other instances were presumably copied >>> from there.) Still, it doesn't quite seem worth back-patching. > >> Is

Re: Error in calculating length of encoded base64 string

2023-06-08 Thread Tom Lane
Gurjeet Singh writes: > On Thu, Jun 8, 2023 at 7:35 AM Tom Lane wrote: >> This bug is very ancient, dating to commit 79d78bb26 which >> added encode.c. (The other instances were presumably copied >> from there.) Still, it doesn't quite seem worth back-patching. > Is it worth investing time in

Re: Error in calculating length of encoded base64 string

2023-06-08 Thread Gurjeet Singh
On Thu, Jun 8, 2023 at 7:35 AM Tom Lane wrote: > > o.tselebrovs...@postgrespro.ru writes: > > While working on an extension I've found an error in how length of > > encoded base64 string is calulated; > > Yeah, I think you're right. It's not of huge significance, because > it just overestimates b

Re: Error in calculating length of encoded base64 string

2023-06-08 Thread Tom Lane
o.tselebrovs...@postgrespro.ru writes: > While working on an extension I've found an error in how length of > encoded base64 string is calulated; Yeah, I think you're right. It's not of huge significance, because it just overestimates by 1 or 2 bytes, but we might as well get it right. Thanks f

Error in calculating length of encoded base64 string

2023-06-08 Thread o . tselebrovskiy
Greetings, everyone! While working on an extension I've found an error in how length of encoded base64 string is calulated; This error is present in 3 files across all supported versions: /src/common/base64.c, function pg_b64_enc_len; /src/backend/utils/adt/encode.c, function pg_base64_enc_le