pgsql: Add stack depth check to QueueFKConstraintValidation().

Started by Tom Lane2 months ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Add stack depth check to QueueFKConstraintValidation().

QueueFKConstraintValidation() recurses through the partition hierarchy
to queue child constraint validations and to mark child rows as
validated. With a sufficiently deep partition tree, this can result
in a stack-overflow crash. Defend against that as we do elsewhere.

Bug: #19482
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: /messages/by-id/19482-4cc37cbf52d55235@postgresql.org
Backpatch-through: 18

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/61ea5cc6a61ff9eb8b3d7b055e507a726e5856c7

Modified Files
--------------
src/backend/commands/tablecmds.c | 3 +++
1 file changed, 3 insertions(+)