1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-24 10:47:04 +03:00

Fix potential NULL-pointer dereference.

Commit 2781b4bea7db357be59f9a5fd73ca1eb12ff5a79 arranged to defer
the setup of after-trigger-related data structures, but
AfterTriggerPendingOnRel didn't get the memo.
This commit is contained in:
Robert Haas 2014-11-10 15:19:56 -05:00
parent bf7ca15875
commit c8df9477f8

View File

@ -4776,7 +4776,7 @@ AfterTriggerPendingOnRel(Oid relid)
* if TRUNCATE/etc is executed by a function or trigger within an updating
* query on the same relation, which is pretty perverse, but let's check.
*/
for (depth = 0; depth <= afterTriggers.query_depth; depth++)
for (depth = 0; depth <= afterTriggers.query_depth && depth < afterTriggers.maxquerydepth; depth++)
{
for_each_event_chunk(event, chunk, afterTriggers.query_stack[depth])
{