Add missing array-enlargement logic to test_regex.c.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Jan 2021 17:53:48 +0000 (12:53 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Jan 2021 17:53:48 +0000 (12:53 -0500)
commit0c7d3bb99f72d66ec6ac63aee4c5fe6d683eee86
treeb2542f545b3d2544efa1f5f9c48e57acc3cd2585
parentcf621d9d84db1e6edaff8ffa26bad93fdce5f830
Add missing array-enlargement logic to test_regex.c.

The stanza to report a "partial" match could overrun the initially
allocated output array, so it needs its own copy of the array-resizing
logic that's in the main loop.  I overlooked the need for this in
ca8217c10.

Per report from Alexander Lakhin.

Discussion: https://postgr.es/m/3206aace-50db-e02a-bbea-76d5cdaa2cb6@gmail.com
src/test/modules/test_regex/test_regex.c