plperl: Correctly handle empty arrays in plperl_ref_from_pg_array.
authorAndres Freund <[email protected]>
Tue, 8 Mar 2016 21:33:24 +0000 (13:33 -0800)
committerAndres Freund <[email protected]>
Tue, 8 Mar 2016 21:42:58 +0000 (13:42 -0800)
commit68dababfe3417399bddd4b10107458c6c13e8626
tree388bb2cd79def1aaec51db1678d505a5e8cc34b0
parentbfb6686e4253809cd55ee8b1ae60edece9a52490
plperl: Correctly handle empty arrays in plperl_ref_from_pg_array.

plperl_ref_from_pg_array() didn't consider the case that postgrs arrays
can have 0 dimensions (when they're empty) and accessed the first
dimension without a check. Fix that by special casing the empty array
case.

Author: Alex Hunsaker
Reported-By: Andres Freund / valgrind / buildfarm animal skink
Discussion: 20160308063240[email protected]
Backpatch: 9.1-
src/pl/plperl/plperl.c