[patch]overallocate memory for curly braces in array_out
Keiichi Hirobe <chalenge.akane@gmail.com>
From: Keiichi Hirobe <chalenge.akane@gmail.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-09-23T11:36:55Z
Lists: pgsql-hackers
Attachments
- array_out_bugfix.patch (application/octet-stream) patch
Hi,
Attached is a patch that fixes a bug
for miscounting total number of curly braces in output string in array_out.
Example1
{{1,2,3},{4,5,6}} -> dims[0] = 2, dims[1]= 3
- Without the patch
8
- After
3
Example2
N size one-dimensional array -> dims[0] = N
- Without the patch
N
- After
1
I used gdb to confirm the above behavior.
Cheers,
Keiichi Hirobe
Commits
-
Fix over-allocation of space for array_out()'s result string.
- 87d9bbca13f9 12.0 landed
- bfdd02f88b96 11.0 landed
- ac863108f56b 9.6.11 landed
- 7ecdeb5f5476 9.3.25 landed
- 6ed095edb776 9.5.15 landed
- 103511723ee2 10.6 landed
- 028fc0bac974 9.4.20 landed