Commit 70ec67e
authored
[BABEL] Fix Invalid Read in IsTopTransactionName (#739)
SetTopTransactionName() stores the transaction name in TopTransactionContext
memory. When the transaction ends, this memory is freed but the name pointer
is not set to NULL, leaving a dangling pointer. A subsequent call to
IsTopTransactionName() then reads freed memory via strcmp().
Introduce ResetTopTransactionName() which NULLs out name. This is called from
pltsql_xact_cb to ensure the pointer is reset on every transaction end.
Extension PR: babelfish-for-postgresql/babelfish_extensions#4717
Task: BABEL-5245
Authored-by: Rucha Kulkarni ruchask@amazon.com1 parent dba1b67 commit 70ec67e
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6543 | 6543 | | |
6544 | 6544 | | |
6545 | 6545 | | |
| 6546 | + | |
| 6547 | + | |
| 6548 | + | |
| 6549 | + | |
| 6550 | + | |
| 6551 | + | |
6546 | 6552 | | |
6547 | 6553 | | |
6548 | 6554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| 538 | + | |
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
| |||
0 commit comments