Skip to content

Commit

Permalink
Fix alpn protocol leakage (#2216)
Browse files Browse the repository at this point in the history
* copy transport configuration to avoid modifying shared object
  • Loading branch information
ekoby authored Jul 11, 2024
1 parent b67700d commit 150e74d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions router/internal/edgerouter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,14 @@ func (config *Config) ensureIdentity(rootConfigMap map[interface{}]interface{})

func (config *Config) loadTransportConfig(rootConfigMap map[interface{}]interface{}) error {
if val, ok := rootConfigMap["transport"]; ok && val != nil {
var tcfg map[interface{}]interface{}
if tcfg, ok = val.(map[interface{}]interface{}); !ok {
config.Tcfg = make(transport.Configuration)
if tcfg, ok := val.(map[interface{}]interface{}); ok {
for k, v := range tcfg {
config.Tcfg[k] = v
}
} else {
return fmt.Errorf("expected map as transport configuration")
}
config.Tcfg = tcfg
}

return nil
Expand Down

0 comments on commit 150e74d

Please sign in to comment.