Skip to content

Commit

Permalink
Fix bug where id not existing in multiplexing map causes panic (#16094)
Browse files Browse the repository at this point in the history
* multiplexing: guard against connection panic

* changelog

* Update vault/plugin_catalog.go

Co-authored-by: Calvin Leung Huang <[email protected]>

Co-authored-by: Calvin Leung Huang <[email protected]>
  • Loading branch information
jasonodonnell and calvn committed Jun 22, 2022
1 parent 8466a64 commit fdfdef9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/16094.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
plugin/multiplexing: Fix panic when id doesn't exist in connection map
```
5 changes: 4 additions & 1 deletion vault/plugin_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ func (c *PluginCatalog) cleanupExternalPlugin(name, id string) error {
return fmt.Errorf("plugin client not found")
}

pc := extPlugin.connections[id]
pc, ok := extPlugin.connections[id]
if !ok {
return fmt.Errorf("plugin connection not found")
}

delete(extPlugin.connections, id)
if !extPlugin.multiplexingSupport {
Expand Down

0 comments on commit fdfdef9

Please sign in to comment.