You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Complete NULL guards for exec_state_call_stack in iterative_exec.c
The previous fix (68f12ee) only protected 2 of 9 unsafe exec_state_call_stack
dereferences. This commit adds NULL guards to the remaining 7 sites that can
crash when exec_state_call_stack is NULL during INSERT EXEC SPI execution.
Protected functions/locations:
1. record_error_state() - guard at top
2. is_error_raising_batch() - guard at top
3. is_xact_abort_on_error() - guard at top
4. abort_transaction() line ~1159 - guard || right-hand side
5. abort_execution() lines ~1207, ~1210 - guard || and direct access
6. exec_stmt_iterative() lines ~1714-1718 - guard error_data block
7. exec_stmt_iterative() line ~1783 - guard condition with || NULL check
8. set_exec_error_data() - guard at top
9. reset_exec_error_data() - guard at top
The exec_state_call_stack can be NULL during INSERT EXEC because the SPI
execution path doesn't always have a full PL/tsql call stack established.
Without these guards, any error during INSERT EXEC would cause a SIGSEGV.
0 commit comments