Commit a39d432
committed
Clear stale FUNC_SLOTS on sqlite3_close
Existing patches keep FUNC_SLOTS populated across sqlite3_close (to
avoid p_app use-after-free during PHP GC mid-step). But the leftover
stale `db` pointers persist process-wide, and may explain why the
three remaining tests pass in fresh-PDO probes but fail mid-suite:
prior tests' UDF registrations leave dangling db references that
later queries' optimizers reach via dispatch_func_bridge.
Patch sqlite3_close to walk FUNC_SLOTS and clear any slot whose
`db` address matches the closing db. This doesn't touch p_app or
invoke destroy callbacks (still safe vs the original UAF), it just
prevents stale db pointers from persisting.1 parent 5f879cf commit a39d432
1 file changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
598 | 646 | | |
599 | 647 | | |
600 | 648 | | |
| |||
0 commit comments