1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-14 08:15:55 -05:00

Crash process when encountered when unknown security settings type was supplied

This commit is contained in:
Shelikhoo 2022-12-17 15:03:32 +00:00 committed by Xiaokang Wang (Shelikhoo)
parent e4188c8604
commit 3631053c2b

View File

@ -278,9 +278,11 @@ func ConfigFromStreamSettings(settings *internet.MemoryStreamConfig) *Config {
if settings == nil {
return nil
}
config, ok := settings.SecuritySettings.(*Config)
if !ok {
if settings.SecuritySettings == nil {
return nil
}
// Fail close for unknown TLS settings type.
// For TLS Clients, Security Engine should be used, instead of this.
config := settings.SecuritySettings.(*Config)
return config
}