Commit Graph

4 Commits

Author SHA1 Message Date
Nathan Wallace
754c7e6832 Nil pointer dereference in waitForPluginLoad closes #4752 (#4896)
* Add test for #4752: Nil pointer dereference in waitForPluginLoad

This test demonstrates the bug where waitForPluginLoad() panics with a nil
pointer dereference when a plugin fails during startup before the reattach
config is set.

The test creates a runningPlugin with reattach=nil and closes the failed
channel, simulating a plugin that fails in startPluginProcess before
initializePlugin is called.

* Fix #4752: Add nil check for reattach in waitForPluginLoad

Adds a nil pointer check before accessing p.reattach.Pid when a plugin
fails during startup. If the plugin fails before the reattach config is
set (e.g., in startPluginProcess), reattach will be nil and the code
would previously panic when trying to log the PID.

The fix checks if reattach is nil and logs an appropriate message in
each case, preventing the panic while still providing useful debugging
information.
2025-11-16 15:53:59 -05:00
Nathan Wallace
e02d7d7d0d Nil pointer check in PluginManager.Shutdown closes #4782 (#4823)
* Add test demonstrating bug #4782 - Shutdown panics with nil pool

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4782: Add nil pool check in PluginManager.Shutdown

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-15 20:17:26 -05:00
Nathan Wallace
d58888e2d2 Nil pointer dereference in OnConnectionConfigChanged closes #4784 (#4829)
* Add test demonstrating bug #4784 - OnConnectionConfigChanged panics with nil pool

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix #4784: Add nil pool check in handlePluginInstanceChanges

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-15 11:32:47 -05:00
Nathan Wallace
2e5f3fda97 Add comprehensive passing tests from bug hunting initiative (#4864) 2025-11-13 09:26:46 +08:00