mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 17:16:47 +00:00
fix: prevent nil pointer dereference in WireGuard initialization (#3148)
This commit is contained in:
1 parent
4dfaa9027d
commit
99c49780fd
1 file changed
+4
@@ -386,6 +386,10 @@ func NewWireGuard(option WireGuardOption) (*WireGuard, error) {
|
||||
}
|
||||
outbound.bind = wireguard.NewClientBind(context.Background(), wgSingErrorHandler{outbound.Name()}, singDialer, isConnect, outbound.connectAddr.AddrPort(), reserved)
|
||||
|
||||
if outbound.bind == nil {
|
||||
return nil, E.New("failed to create wireguard client bind")
|
||||
}
|
||||
|
||||
var err error
|
||||
outbound.localPrefixes, err = option.Prefixes()
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user