Repository: fatedier/frp (language: go)

Issue:
`panic: runtime error: invalid memory address or nil pointer dereference`
### Bug Description

frpc 验证 INI 时“恐慌”

### frpc Version

0.52.0

### frps Version

0.52.0

### System Architecture

linux/amd64

### Configurations

```ini
[common]
server_addr = frp.wo25.net
server_port = 27100
protocol = quic
token = xqzr
user = ••••
login_fail_exit = false
log_level = debug
tls_trusted_ca_file = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
pool_count = 5
admin_addr = ::1
admin_port = 17400
start = ••••_SSH,#••••,#••••_tcp,#••••_udp,#••••_tcp,#••••_udp,••••_https,••••_quic,••••_MC,••••,#••••,••••_p2p,••••_p2p,#••••_p2p,••••_p2p,••••_p2p,••••_p2p

[••••_SSH]
type = tcp
local_ip = ::1
local_port = 22
remote_port = 21022
meta_uuid = ••••

[••••]
type = tcp
local_ip = 192.168.1.0
local_port = 22
remote_port = 20022

[••••_tcp]
type = tcp
local_ip = 192.168.1.6
local_port = 3389
remote_port = 22389
meta_uuid = ••••

[••••_udp]
type = udp
local_ip = 192.168.1.6
local_port = 3389
remote_port = 22389
meta_uuid = ••••

[••••_tcp]
type = tcp
local_ip = 192.168.1.7
local_port = 3389
remote_port = 21389
meta_uuid = ••••

[••••_udp]
type = udp
local_ip = 192.168.1.7
local_port = 3389
remote_port = 21389
meta_uuid = ••••

[••••_https]
type = tcp
remote_port = 20443
plugin = unix_domain_socket
plugin_unix_path = /dev/shm/••••.socket
meta_uuid = ••••
proxy_protocol_version = v2
#bandwidth_limit = 1500KB

[••••_quic]
type = udp
remote_port = 20443
#plugin = unix_domain_socket
#plugin_unix_path = /dev/shm/••••.socket
local_ip = ::1
local_port = 443
meta_uuid = ••••


[••••_MC]
type = tcp
local_ip = ::1
local_port = 25565
remote_port = 32065
meta_uuid = ••••

[••••_p2p]
type = xtcp
sk = 0
local_ip = ::1
local_port = 25565

[••••-mod]
type = tcp
local_ip = ::1
local_port = 32165
remote_port = 32165
meta_uuid = ••••

[••••]
type = udp
local_ip = ::1
local_port = 19132
remote_port = 32065
meta_uuid = ••••

[••••_p2p]
type = xtcp
sk = ••••
local_ip = ::1
local_port = 22

[••••_p2p]
type = xtcp
sk = ••••
local_ip = 192.168.1.7
local_port = 3389

[••••_tcp_p2p]
type = xtcp
sk = ••••
local_ip = 192.168.1.6
local_port = 3389

[••••_p2p]
type = xtcp
sk = ••••
plugin = unix_domain_socket
plugin_unix_path = /dev/shm/••••.socket

[••••_p2p]
type = xtcp
sk = ••••
plugin = unix_domain_socket
plugin_unix_path = /dev/shm/••••.socket
```

### Logs

_No response_

### Steps to reproduce

`frpc verify -c /etc/frp/1.ini`
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x838427]

goroutine 1 [running]:
github.com/fatedier/frp/pkg/config.LoadClientConfig.func1({0x0?, 0x0?}, 0x4139b7?)
        github.com/fatedier/frp/pkg/config/load.go:226 +0x27
github.com/samber/lo.Filter[...]({0xc0001e1d00, 0xa, 0xa}, 0xc00017f608?)
        github.com/samber/lo@v1.38.1/slice.go:15 +0xc3
github.com/fatedier/frp/pkg/config.LoadClientConfig({0x7fff221a6642, 0xe})
        github.com/fatedier/frp/pkg/config/load.go:225 +0x9d1
github.com/fatedier/frp/cmd/frpc/sub.glob..func3(0x113a3c0?, {0xb82ecf?, 0x2?, 0x2?})
        github.com/fatedier/frp/cmd/frpc/sub/verify.go:40 +0x45
github.com/spf13/cobra.(*Command).execute(0x113a3c0, {0xc000131560, 0x2, 0x2})
        github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x113a0e0)
        github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.7.0/command.go:992
github.com/fatedier/frp/cmd/frpc/sub.Execute()
        github.com/fatedier/frp/cmd/frpc/sub/root.go:98 +0x25
main.main()
        github.com/fatedier/frp/cmd/frpc/main.go:23 +0x17
```

### Affected area

- [ ] Docs
- [X] Installation
- [ ] Performance and Scalability
- [ ] Security
- [X] User Experience
- [ ] Test and Release
- [ ] Developer Infrastructure
- [ ] Client Plugin
- [ ] Server Plugin
- [ ] Extensions
- [ ] Others


Discussion / hints:

Fix patch:
diff --git a/pkg/config/legacy/conversion.go b/pkg/config/legacy/conversion.go
index 189cd73dbdb..7a550947b64 100644
--- a/pkg/config/legacy/conversion.go
+++ b/pkg/config/legacy/conversion.go
@@ -306,6 +306,7 @@ func Convert_ProxyConf_To_v1(conf ProxyConf) v1.ProxyConfigurer {
 		c := &v1.XTCPProxyConfig{ProxyBaseConfig: *outBase}
 		c.Secretkey = v.Sk
 		c.AllowUsers = v.AllowUsers
+		out = c
 	}
 	return out
 }


Test patch:
diff --git a/test/e2e/framework/consts/consts.go b/test/e2e/framework/consts/consts.go
index 1e5ca500401..4c7c2f13cc1 100644
--- a/test/e2e/framework/consts/consts.go
+++ b/test/e2e/framework/consts/consts.go
@@ -25,6 +25,7 @@ log.level = "trace"
 	DefaultClientConfig = `
 serverAddr = "127.0.0.1"
 serverPort = {{ .%s }}
+loginFailExit = false
 log.level = "trace"
 `
 
@@ -38,6 +39,7 @@ log.level = "trace"
 	[common]
 	server_addr = 127.0.0.1
 	server_port = {{ .%s }}
+	login_fail_exit = false
 	log_level = trace
 	`
 )
diff --git a/test/e2e/framework/process.go b/test/e2e/framework/process.go
index 437c8997ca5..139753e8d0e 100644
--- a/test/e2e/framework/process.go
+++ b/test/e2e/framework/process.go
@@ -40,6 +40,7 @@ func (f *Framework) RunProcesses(serverTemplates []string, clientTemplates []str
 		currentServerProcesses = append(currentServerProcesses, p)
 		err = p.Start()
 		ExpectNoError(err)
+		time.Sleep(500 * time.Millisecond)
 	}
 	time.Sleep(1 * time.Second)